Too slow readln

Jon Degenhardt via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jul 16 10:37:34 PDT 2017


On Sunday, 16 July 2017 at 17:03:27 UTC, unDEFER wrote:
> [snip]
>
> How to write in D grep not slower than GNU grep?

GNU grep is pretty fast, it's tough to beat it reading one line 
at a time. That's because it can play a bit of a trick and do the 
initial match ignoring line boundaries and correct line 
boundaries later. There's a good discussion in this thread ("Why 
GNU grep is fast" by Mike Haertel): 
https://lists.freebsd.org/pipermail/freebsd-current/2010-August/019310.html

--Jon


More information about the Digitalmars-d-learn mailing list