Re: Too slow readln

2017-07-16 Thread Ali Çehreli via Digitalmars-d-learn
On 07/16/2017 10:37 AM, Jon Degenhardt wrote: 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 Another fast GNU utility was on Reddit a month ago:

Re: Too slow readln

2017-07-16 Thread unDEFER via Digitalmars-d-learn
I understand the main problem. dirEntries by default follows symlinks. Without it my first grep works only 28.338s. That really cool!

Re: Too slow readln

2017-07-16 Thread unDEFER via Digitalmars-d-learn
On Sunday, 16 July 2017 at 17:37:34 UTC, Jon Degenhardt wrote: 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

Re: Too slow readln

2017-07-16 Thread Jon Degenhardt via Digitalmars-d-learn
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

Too slow readln

2017-07-16 Thread unDEFER via Digitalmars-d-learn
Hello, there! I have the next "grep" code: https://dpaste.dzfl.pl/7b7273f96ab2 And I have the directory to run it: $ time /home/undefer/MyFiles/Projects/TEST/D/grep "HELLO" . ./strace.log: [pid 18365] write(1, "HELLO\n", 6HELLO real1m17.096s user0m54.828s sys 0m13.340s The same