[fpc-pascal] Memory alignment with FPC

dhkblaszyk at zeelandnet.nl dhkblaszyk at zeelandnet.nl
Thu Oct 11 13:59:50 CEST 2012


On 10 okt '12, dhkblaszyk at zeelandnet.nl wrote: 

> One more
question, when using packed records, is there anything to say about
performance? Are there some tests anywhere that show how the performance
is impacted?

I did some performance tests on win32 and it appears that
both packed and unpacked objects and records all show exactly the same
performance. Writing the individual variables in a record or object to
file takes about 5.5 times longer than writing them at once. If someone
wants my test app to run it on other platforms please let me know then I
can post the code. I will do more testing later on mac and linux32. I'm
interested how win64 and linux64 behave in this respect. So if someone
has these architectures please let me know. 

This makes me wonder if
choosing a proper value for $PACKRECORDS could make my file readable
safely on all platforms, only needing to convert the endianess if
applicable. This would not force me to do manual padding in my structs.
Say I use a value of 16 would that cover all ABI's FPC currently

Jonas: do you have an overview of the alignment on all
architectures that FPC supports? Perhaps you could pinpoint where in the
compiler this is handled? If appreciated I could make a patch to include
this info in the documentation in the future. 

Regards, Darius 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20121011/f0c6d8bf/attachment.html>

More information about the fpc-pascal mailing list