How to accelerate this program?

Li Jie cpunion at gmail.com
Mon Apr 3 19:33:17 PDT 2006


In article <e0re95$12mg$1 at digitaldaemon.com>, Dave says...
>
>
>From what I've seen, the bottleneck is probably in I/O. Use BufferedFile and a
>buffer for each readline. On my system with a file made of 440,000 lines of
>(just 4 repeated) seperate emails, this version takes ~200 ms vs. ~800 ms for
>your C++ version. Buffering I/O is key in D w/ the phobos I/O routines, as the
>built-in AA's are pretty fast.
>
>Let us know your results (you'll have a lot more AA inserts and email dups).
>Note you have to dup the string when you insert into your AA.
>
>Try this (dmd v0.150):

Thanks Dave.

But it takes ~3400 ms on my system, on windows and gentoo.





More information about the Digitalmars-d mailing list