Disable garbage collection for gyp_chromium.

Python always does reference counting and that handles most of the
objects used by GYP. The GC is used to detect and drop circular
references. If GC is turned off then the heap scanning can be skipped
to save some CPU cycles, and the memory leaked due to circular
references isn't noticeable.

This saves about 1 second out of 16 on Linux in a Z620 workstation.

BUG=None

Review URL: https://codereview.chromium.org/495993002

Cr-Commit-Position: refs/heads/master@{#291287}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@291287 0039d316-1c4b-4281-b951-d872f2087c98
parent 24d30aba
......@@ -188,6 +188,13 @@ def additional_include_files(supplemental_files, args=[]):
if __name__ == '__main__':
# Disabling garbage collection saves about 1 second out of 16 on a Linux
# z620 workstation. Since this is a short-lived process it's not a problem to
# leak a few cyclyc references in order to spare the CPU cycles for
# scanning the heap.
import gc
gc.disable()
args = sys.argv[1:]
use_analyzer = len(args) and args[0] == '--analyzer'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment