In the past we have read the image file into a pre-allocated chunk of memory allocated via mmap, now I have changed to a more complicated but faster method of reading which then allows us to someday depending on your VM to avoid re-swizzling pointers for an image that is launched on a unix, windows, or iPhone since all oops should start on the 500MB boundary.

What happens is we mmap the image file with copy on write mmap into a segment of memory starting at a real address of 500MB (500*1024*1024), the next virtual memory page follow the size of the file then is anonymously mmap upto the maximum memory size choosen for the implmentation. In this case we allocate 512MB of memory which is a settable option in the info.plist.


I had a chance to evaluate the impact of this on an older powerbook G3, what I found is the traditional way of doing things required just about 550 ms of time as it reads in the image and iterates over the objects. After the change and saving the image so that you've a 500MB start location, that 550ms of time is reduced to about 125ms. On slower devices like the
iphone the improvement is measured in seconds.


--
= = = ========================================================================
John M. McIntosh <[EMAIL PROTECTED]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
= = = ========================================================================




_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to