On Tue, 13 Jun 2006, Bisma Jayadi wrote:
> > 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. Maybe, but if performance is an issue, then we wouldn't be using simple write() statements... > > > 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? Yes. TP compatibility. The "Text" internal record contains the 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. :) As far as I saw, none of the functions you used required use of the dos unit. The FlushFunc:=Nil is totally not needed. Setting of the IO buffer are standard system unit functions. Michael. _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
