discuss-gnustep
[Top][All Lists]
Advanced

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

Re: objective-c: how slow ?


From: Marko Mikulicic
Subject: Re: objective-c: how slow ?
Date: Fri, 31 Aug 2001 17:15:21 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801

Frederic Stark wrote:
Hi,

All this IMHO, of course.



Given an infinite time to design and optimize, the performance is, from best to worse:

* C
* C++
* ObjC
* Java

(Java could be faster than ObjC with an exceptionally good interpreter, but, in my experience it does not happend. YMMV)


does the current objc compiler/runtime optimizes in some way
message lookups (inline caches, polymorphic inline caches,...).
 In the case of negative answer, would it be very bad to allow the
runtime to dynamically modify the machine code of a objc method ?

If plain objc code could be as fast as with IMP kludges, it would
be more maintenable and flexile, preserving performance to the common
case.

Marko

PS:
Polymorphic inline caches (PIC) have the cost of a test and a direct jump in the best case (cache hit) and 3 or 4 tests (pipelined) and a normal method lookup. There could be performance issues because of the self-modifying code (icache flushes) but a cache update should not happen frequently.
Please refer to the Self prototyping OO language implementation,
and documentation for furhter informations look at: http://www.sun.com/research/self/




reply via email to

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