On Fri, 15 Oct 2010 20:06:47 +0400, Andrei Alexandrescu <seewebsiteforem...@erdani.org> wrote:

On 10/14/2010 09:01 PM, Denis Koroskin wrote:
On Fri, 15 Oct 2010 05:49:05 +0400, Andrei Alexandrescu
<seewebsiteforem...@erdani.org> wrote:
Btw, I've re-run my tests, O_DIRECT works but also has no effect. Best
of 3 results for parsing 33Mb log file:

using getline (C++ -O2):
real 0m0.081s
user 0m0.068s
sys 0m0.016s

using byLine (D -O -release -inline):
real 0m0.067s
user 0m0.056s
sys 0m0.012s

That's a 20% difference. Source and test files here:
http://rapidshare.com/files/425154119/tests.7z 309k
http://rapidshare.com/files/425154408/tests.zip 6Mb (in case you have no
7z installed)

I confirm byLine is faster than getline after translating getline to D. byLine does crash intermittently so it has a bug somewhere, but I assume fixing it won't reduce its performance significantly.

Results on my system on a 20x larger test file (obtained with repeat 20 { cat WindowsUpdate.log >> big.log } && mv big.log WindowsUpdate.log) are (median of 5): 1.759 vs. 1.516 seconds (14% improvement).


Andrei

With introduction of consume (http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=119414) it got another 40% improvement for counting lines and chars (it doesn't copy anything at all now).

Reply via email to