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

CF Performance vs. Foundation (Re: Worth it for an object to cache its own IMPs?)



On Mar 1, 2004, at 6:30 AM, Scott Stevenson wrote:

>
> On Feb 29, 2004, at 2:29 AM, Markus Hitter wrote:
>
>> How about using local C functions? Working code goes into these 
>> functions while the method melts down to one line of code, calling 
>> one of these functions. Class-internally you use the functions while 
>> other classes use the methods. Should be even faster than IMP 
>> caching.
>
> Okay, so the question then becomes this:
>
> The code in question involves a lot of plist/dictionary/array parsing 
> and such. Is it a reasonable strategy to switch over to c functions 
> that use CF types? In other words, is there going to be much of a 
> difference if I'm still using CF objects inside the function, or do I 
> need to drop down all the way to plain old ansi c strings and 
> structures to see any material speedup?
>
> I've done some googling and mamasaming, but have found very little in 
> the way of discussions regarding Foundation vs. CF performance.
>

What do you mean by parsing? Reading from a file and building a tree 
structure or walking the structure already built? Extracting parts of 
files or reading complete files as trees of objects for later perusal?

If you need a very fast file parser than probably flex/bison will 
generate the fastest custom parsing code for you - but it is plain 
C....

On the other hand, there is a lot of I/O and lexical analysis and other 
things going on when reading a file and converting byte stream to 
something else, so I doubt that message sending overhead can be noticed 
at all...

izidor