Restore GC and add comments to clarify why we turn it off, fixes #3488, closes #3503

main
Jordi Boggiano 8 years ago
parent 0ed5b541a9
commit c2d78e5ce0

@ -163,6 +163,10 @@ class Installer
*/
public function run()
{
// Disable GC to save CPU cycles, as the dependency solver can create hundreds of thousands
// of PHP objects, the GC can spend quite some time walking the tree of references looking
// for stuff to collect while there is nothing to collect. This slows things down dramatically
// and turning it off results in much better performance. Do not try this at home however.
gc_collect_cycles();
gc_disable();
@ -341,6 +345,11 @@ class Installer
}
}
// re-enable GC except on HHVM which triggers a warning here
if (!defined('HHVM_VERSION')) {
gc_enable();
}
return 0;
}

Loading…
Cancel
Save