--- Begin Message ---
Subject: |
Re: Cocoa/Windows parallel dvlpmt |
Date: |
Thu, 5 Feb 2004 09:29:35 +1100 |
>> There's another point I must mention - an app compiled with GnuStep
>> under Red Hat is an order of magnitude slower, in some areas, than
>> one compiled using XCode. The Gnu ObjC runtime appears to be very
>> slow, contrary to what it's maintainers claim. For the two projects
>> I've considered using GnuStep for, the performance was simply too
>> poor. Since I consequently had to write [at the least] the core of
>> both projects in C/C++, I decided to just use GTK for the UI anyway,
>> and the STL of course for my containers & algorithms. A much better
>> solution, I've found.
>
>Would you mind to tell us about the performance problems you did find
>with GNUstep or the GNU ObjC runtime? Perhaps a small sample application
>showing this difference in the behaviour on Cocoa and GNUstep? If we
>know about or problems we might be able to fix them.
>I heared there are some small things, that Apple does faster than
>GNUstep, but I never did see any bigger program showing a significant
>difference. So I am very curious.
I never really narrowed it down properly, but the basic scenario was that I had
homogenous NSArray's containing tens/hundreds of thousands of items, and I was
stepping through those arrays, calling certain predictable methods on each,
removing/adding items here and there, etc etc.
It seems the two biggest bottlenecks were NSArray performance and messaging
speed. I would have been sending millions of messages a second (ideally; in
reality I didn't meet this). The NSArray performance didn't seem that much
worse than Apple's - i.e. slow anyway - so I can only imagine it was the
messaging speed that was the problem. I didn't really use any other classes,
and I of course subtracted the performance of the C-based core from my
measurements.
The end result was that the comparative performance was at least 5 times worse
than simplying compiling with Apple's gcc and runtime. Using the same compiler
flags of course (-g -O2 -Wall, from memory). This translated to about half the
performance of the entire app, given that most of the app's time was spent in
non-ObjC areas.
I wish I could release the source, but of course it's owned by my employer.
It's a simple scientific tool, and I'm just a summer temp, so hopefully they'll
release it as open source in a few weeks, at the end of my employment. If they
do I'll make sure to tell you.
Wade Tregaskis
P.S. I tried a few things to improve performance, like resolving methods to
IMP's and so forth, which did help, but not significantly for either GnuStep
nor Apple's runtime.
--- End Message ---