[Pyobjc-dev] Bridge Support Performances
Brought to you by:
ronaldoussoren
From: Virgil D. <hs...@ha...> - 2010-01-20 11:58:34
|
Hi there, I recently started to use PyObjC 2.2 (after having use 1.4 for a long time), mainly for 64-bit support, and the biggest problem I have with it is bridge support's memory usage. One of my applications which used to use 22mb of memory on launch when built with pyobjc 1.4 used 48mb when built with pyobjc 2.2. I have read that other thread about it and Ronald mentioned that this was because of bridge support code which he didn't have enough time to work on. I plan to try to tackle the issue soon and I'd appreciate your feedback, Ronald, so I can know early if I'm just on a fool's errand. As a stopgap measure, I plan to simply clone the Cocoa and Foundation packages and remove everything I don't use from the bridgeSupport xml files. My guess is that it will greatly enhance loading speed and memory usage since I only use a tiny fraction of Foundation and AppKit. Then, I noticed that Foundation and AppKit bridgesupport files are huge, not really because there's a lot of symbols in them (there are, however), but because the XML file format has so much redudancy in it (For example, funtion arguments elements require way too much crap. the types could be one string for 32 bit and one string for 64 bit instead of being this long list of <arg> element). What I'm thinking about is to convert those bridge support files to a more concise format, maybe in YAML or something. This wouldn't help memory usage, but it might help loading speed. Last, the most important part of my super plan, would be smart importers. I don't know much about them, but I keep seeing that Brett Canon keeps writing article about custom imports and stuff. Maybe that by using this, we could make PyObjC only load the requested elements. If, for example, someone would type "from AppKit import symbol1, symbol2" instead of "from AppKit import *", then only symbol1 and symbol2 would be loaded from the bridge support. So, what do you think? Is that plan realistic, will there be a show-stopper down the road? -- Virgil Dupras Hardcoded Software http://www.hardcoded.net |