Hello,
can't you increase the I/O size? I've tested large-scale I/O buffers
(80K and over) with pascal with 4x the speed of C or C++ code. Not on
the FPC compiler, though.
Hope this helps.
Thierry Coq
Bisma Jayadi a écrit :
All you do is compare standard IO performance. You don't compare the
compiled code's speed.
I know. But I/O performance benchmarking is one of the basic language
comparison item. When you want to participate on ACM contest
(http://acm.uva.es/problemset) that would be one of biggest obstacle
to get on top rank.
By default FPC uses a 256 byte buffer for text IO; The C library uses a
4K buffer. Obviously, C's input/output will be faster by a large factor.
This would raise a simple basic question... why FPC doesn't also use
4K buffer? If it'd improve I/O performance a lot. Any specific
technical reasons why FPC decide to allocate 256 byte for I/O buffer?
Secondly, you should do at least 10-20 test runs of your program. I did
the test, and the optimized, stripped FPC version runs as fast as the C
version on average.
I did. All time result I said before was the average of 10 test runs.
Sorry to forget mentioning that. :)
Third, adding the DOS unit adds the overhead of loading /etc/timezone
stuff, further slowing down your program, because it is additional IO...
But I need some functions from the DOS unit. Or should I copy and
paste required functions from DOS unit to eliminate timezone loading
overhead? I think that wouldn't be an elegant solution. :)
-Bee-
has Bee.ography at:
http://beeography.wordpress.com
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives