6 ms·
Can someone write a TL;DR how this works? I've read a bit about ag, which is rather fast compared to anything in the wild, and it seems that it utilises all to
by trymas 11y ago
Can someone write a TL;DR how this works?
I've read a bit about ag, which is rather fast compared to anything in the wild, and it seems that it utilises all tools to make it as fast as possible. Though, sift can be up to 8 times as fast. How?
EDIT: also I remember, that the last time it was posted here (or either /r/programming), the benchmark was considered not true. Few checks on few folders (from big to small) renders sift slower than ag from 5 to 20 times (though probably faster than grep and/or ack).
EDIT2: https://github.com/svent/sift/issues/7 https://github.com/svent/sift/issues/7 - about benchmarks. Maybe numbers are true, but they are done in rather specific conditions, with specific cases, where sift can be possibly faster. But in general development it will be rather slow.
- snordlast 11y agoIt's basically equivalent to: $ export LC_ALL=C; grep ... The regular grep works on Unicode, which can be 10 times slow. Sift works on plain bytes. Also sift benchmark is somewhat inflated. Test on your own data.
- agumonkey 11y agoThere was an article about haskell vs C where, haskell would appear slow at first because its string type was unicode while C was ascii. When using unicode the c code suddenly was a bit slower than haskell's. Details matter.
- hawkice 11y agoTo be perhaps even more fair, Haskell's String type is actually a singly linked list of unicode 32 characters, so you'd want C to use unicode and Haskell to use ByteString (or Text).