On Sat, 27 Oct 2012 20:38:58 -0700 "Gregory P. Smith" <g...@krypto.org> wrote: > > Another thing to keep an eye out for within a startup profile: how often > does the gc collect? our default gc collection thresholds haven't been > tuned in ages afaik [or am i forgetting something] and I know of > pathological cases at work where simply doing a gc.disable() before > importing a bunch of modules (tons of generated protocol buffer code) and > re-enabling it afterwards speeds up this application's startup way more > significantly than seems healthy in 2.x... that could be related to the > particulars of the protobuf module code though.
http://bugs.python.org/issue16351 shows us that the number of collections at 3.4 startup is tiny: $ ./python -Sc "import gc; print(gc.get_stats())" [{'collections': 6, 'uncollectable': 0, 'collected': 0}, {'collections': 0, 'uncollectable': 0, 'collected': 0}, {'collections': 0, 'uncollectable': 0, 'collected': 0}] $ ./python -c "import gc; print(gc.get_stats())" [{'collected': 0, 'uncollectable': 0, 'collections': 12}, {'collected': 0, 'uncollectable': 0, 'collections': 1}, {'collected': 0, 'uncollectable': 0, 'collections': 0}] Notably, there are no full collections. Regards Antoine. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com