[merge] use os._exit

Martin Pool mbp at sourcefrog.net
Fri Feb 16 06:02:37 GMT 2007


John Arbash Meinel wrote:

> 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.

Right - I would not want to put it in a place where the test code or a
library user would ever have it happen accidentally, but as it is
replacing sys.exit I think it's safe.

I agree avoiding finalization seems strange but as you know it's not
really reliable in Python, and anyhow for reasons like windows file
handling and locking we have to be careful about unwinding.  If this
makes any omissions more prominent I'd almost think it a feature.
Anyhow manually destructing all the code objects really is just an utter
waste of time.

I've cleaned it up a bit more and will send it now.

> 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.

-- 
Martin



More information about the bazaar mailing list