[Issue 17229] File.byChunk w/ stdout.lockingTextWriter is very slow

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Feb 27 15:51:20 PST 2017


https://issues.dlang.org/show_bug.cgi?id=17229

--- Comment #1 from Jon Degenhardt <jrdemail2000-dlang at yahoo.com> ---
(In reply to Jon Degenhardt from comment #0)

> Results for the count 9's program, against the 2.7, 14 million line file:
>    byLine:  8.98 seconds
>    byChunk: 1.64 seconds

Update: The byLine Count 9s program given above is being affected by
autodecode. Changing counting line as follows:

  from: chunkedStream.each!(x => count += x.count('9'));
  to:   chunkedStream.each!(x => count += (cast(ubyte[])x).count('9'));

Gives updated times:
  byLine:  3.13
  byChunk: 1.64

This is more consistent. byChunk is faster than byLine in the Count 9s task
(read and access data), by not by 5x. The 15x performance deficit of byChunk
relative to byLine on the file copy task remains.

--


More information about the Digitalmars-d-bugs mailing list