discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: apple's objc runtime on linux?


From: Benhur Stein
Subject: Re: apple's objc runtime on linux?
Date: Fri, 07 Nov 2003 20:06:21 -0200

On 2003-11-07 12:57:06 -0200 Markus Hitter <mah@jump-ing.de> wrote:

How about installing Darwin and do the comparison there? GNU runtime should compile out of the box there.
Well, it passed my mind, but I thought it would be too much work.

In fact, it is a curiosity I have, which runtime is faster, and why there always comes the idea of unifying runtimes in favor of the apple one. Is it really better, and in which aspect? One thing I heard (but it was a long time ago, when I got to know objc, maybe it is not like this anymore), was that one great advantage of gnu's runtime is that it is thread-safe without the need of locks, while next's behaved differently on multi-threaded
and single-threaded programs.
I took a rapid look at the message sending code of both runtimes and I really doubt that
apple's can be faster than gnu's.

Some simple measurements I've made on gnu's runtime (time to do 1e9 calls
to an empty method/function):

19.5 normal method call
 6.8 indirect pointer (IMP)
 5.1 direct call to 2-arg function
 4.2 direct call to void function
 0.5 empty loop

Inlining part of objc_msg_lookup (something that could be done by the compiler),
time goes to 9.3 (but it uses 25 instructions instead of 6).

Sure, if the method/function does something, this numbers become closer...

Benhur





reply via email to

[Prev in Thread] Current Thread [Next in Thread]