« iTunes Music Store - 25 Million Songs | Main | Started writing opti-8, IMP Caching Deluxe With Foundation »

GnuSTEP NSAutoreleasePool

Well, I figured a bit late that Gnustep oughta have its own implementation of NSAutoreleasePool, so I am just downloading and see how that works...

Well first of all it's way of adding objects to the pool is actually identical to the way I did.

They also seem to optimize the creation of autorelease pools, by not actually freeing old instances of a thread but keeping them around. Now I don't know... At first I thought that would be superflous, as I rarely ever allocate NSAutoreleasePools. But if you have loops where you create and destroy them often to conserve memory it could be conceivably worth it. I'd bet that this has no measureable effect whatsoever, except in synthetic benchmarks. Which .. makes it worth it :)

Deallocation of pooled objects is implemented naively in GNUstep :).

So I'd expect that the MulleAutoreleasePool would handily beat the GNUstep NSAutoreleasePool when the pool contains many objects. The NSAutoreleasePools for each thread are stored in the pthread's (actually cthread's) thread dictionary. I have no idea if this is faster or slower than what I did. I used my own local dictionary, indexed by pthread_self. Gotta peek into Darwin for this.

About

This page contains a single entry from the blog posted on December 16, 2003 2:09 AM.

The previous post in this blog was iTunes Music Store - 25 Million Songs.

The next post in this blog is Started writing opti-8, IMP Caching Deluxe With Foundation.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 4.25