[fpc-devel] Pointer cache for fast class/pointer access.

Florian Klämpfl florian at freepascal.org
Wed Jan 4 22:20:47 CET 2012

Am 04.01.2012 19:24, schrieb Hans-Peter Diettrich:
> Skybuck Flying schrieb:
>> -----Original Message----- From: Hans-Peter Diettrich
>> Sent: Tuesday, January 03, 2012 14:56
>> To: FPC developers' list
>> Subject: Re: [fpc-devel] Pointer cache for fast class/pointer access.
>> Skybuck Flying schrieb:
>>> vValue := mDepth1.mDepth2.mDepth3.mValue;
>> "
>> You can implement such a funny hierarchy in any language. So what?
>> "
>> For the performance of the line of code above it matters if TObject or
>> Object is used.
> Ah, now I understand what you mean. Nonetheless I don't see sane reasons
> for creating such (deeply nested) structures in real life code - records
> would serve the same (demonstrated) purpose.

If one really suffers from cache misses, then using prefetch(...) might
be a good idea. And if data is heavily used, the CPU keeps it in the
caches anyways and then CPU is very good in this. I doubt any serious
perforance where data locked into L1 cache could improve program
performance. Experience showed that any static predictions like this are
much worse than that what the CPU can do at run time.

More information about the fpc-devel mailing list