Transient ranges

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Mon May 30 08:55:39 PDT 2016


On 05/30/2016 12:22 AM, Jack Stouffer wrote:
> On Sunday, 29 May 2016 at 17:36:24 UTC, Steven Schveighoffer wrote:
>> Wholly disagree. If we didn't cache the element, D would be a
>> laughingstock of performance-minded tests.
>
> byLine already is a laughingstock performance wise:
> https://issues.dlang.org/show_bug.cgi?id=11810

That has been fixed a long time ago by 
https://github.com/dlang/phobos/pull/3089, I just marked it as fixed.

> It's way faster to read the entire file into a buffer and iterate by
> line over that.

Sometimes yes, but that's a change of approach with its own tradeoffs 
(e.g. what if you want to stop early, the file is very large etc. etc).


Andrei



More information about the Digitalmars-d mailing list