[Issue 11810] New: std.stdio.byLine/readln performance is very bad

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Dec 24 04:34:33 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11810

           Summary: std.stdio.byLine/readln performance is very bad
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: peter.alexander.au at gmail.com


--- Comment #0 from Peter Alexander <peter.alexander.au at gmail.com> 2013-12-24 04:34:29 PST ---
std.stdio.readln (and hence byLine) use repeated calls to fgetc() to find the
new line characters. This is a very inefficient way to read files (lots of
per-byte overhead).

I have a version of byLine that reads the files in 4kb chunks and then does the
new line search. It is 6 times faster than byLine on my machine on a 10MB file
(OSX 10.8.5, x64 2GHz MacBook).

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list