Re: Mulle kybernetiK presents: Optimized Object Generation
Re: Mulle kybernetiK presents: Optimized Object Generation
- Subject: Re: Mulle kybernetiK presents: Optimized Object Generation
- From: Marcel Weiher <email@hidden>
- Date: Fri, 8 Mar 2002 01:44:43 +0100
On Friday, March 8, 2002, at 01:05 AM, Nat! wrote:
Am Freitag den, 8. Mdrz 2002, um 00:31, schrieb Nat!:
Thanks for tolerating this obvious spam :)
Ahem sorry, the new article is
http://www.mulle-kybernetik.com/artikel/Optimization/opti-5.html
Some more spam:
MPWFoundation has had a pre-fab allocation pool object for a couple of
years now. It not only keeps the pool, but also uses IMP-caching to
speed up overall operations (since the object class is well-known at
that time). It also offers fine-grain control over the safety vs. speed
tradeoff: by default, it will autorelease the objects it returns and
use locking to be thread-safe. This is usually necessary when you use a
pool as a global allocator for a class.
However, when you have a local pool, you can often do without locking.
Furthermore, in many cases, the allocation patterns are such that you
can also drop the autorelase. In this case, you can use the recycled
objects without even a single retain/release event.
Here are the timings, taken from the Notes.rtf file in MPWFoundaton
(done way back when...)
Basic measures of allocation performance (with Trampolines) on a beige
233 MHz G3 running MacOS-X-Server CR1.
alloc+init+autorelease: ~5.513 microseconds
cache-alloc+retain+autorelease: ~1.782 microseconds
(ditto thread-safe disabled): ~1.787 microseconds
(ditto thread-safe enabled): ~2.227 microseconds
cache-alloc w/o retain (unsafe) ~0.917 microseconds
(ditto thread-safe disabled): ~0.928 microseconds
(ditto thread-safe enabled): ~1.142 microseconds
cache-alloc w/o retain (unsafe) ~0.457 microseconds
+ no autorelease-pools at all
plain msg-send (for comparison): ~0.216 microseconds
IMP-call of same message: ~0.105 microseconds
Marcel
--
Marcel Weiher Metaobject Software Technologies
email@hidden www.metaobject.com
Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.