[merge] use os._exit
John Arbash Meinel
john at arbash-meinel.com
Thu Feb 15 14:55:08 GMT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
John Arbash Meinel wrote:
> Martin Pool wrote:
>>> This changes bzr to exit through os._exit when it's done. This function
>>> differs from sys.exit in that it does not finalize or gc any objects
>>> that still exist. That has two benefits:
>>>
>>> It suppresses the intermittent failure of the smartserver
>>> tests that I wrote about yesterday -- python never goes into
>>> the terrible state of modules disappearing while in use
>>>
>>> By avoiding gc of things that are about to be destroyed we save some
>>> time at shutdown -- about 50ms in my test, or 14% of the time to do bzr
>>> status in a bzr tree.
>
> I like the performance improvements, but avoiding finalization and gc
> seems a little unclean.
After looking closer, I'm probably +0, since this is occuring only in
the main 'bzr' script, and not in any of the bzrlib code.
I did try the gc.disable() trick that was mentioned in IRC, and it
dropped the 'bzr rocks' time down to 148ms, so between os._exit() and
gc.disable() we spend 50ms in 'bzr rocks' just doing cleanup.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFF1HRMJdeBCYSNAAMRAoYPAKCihaWEXUASZQ18WS6vMmNekqunewCfRq0q
r14FW3ghREteUengkJNiNWI=
=w4G+
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list