3 ms·
Doesn't this approach require that you start with a sequential scan of the file to break it into lines? And does the fact that you beat grep by 8-10x, even aft
by haberman 13y ago
Doesn't this approach require that you start with a sequential scan of the file to break it into lines? And does the fact that you beat grep by 8-10x, even after this up-front cost, then imply that such a scan is at least 10 times faster than an actual grep? If so that's surprising; I thought that grep was a lot closer to the raw cost of scanning a string.
- Peaker 13y agoI am not an expert on CUDA, but couldn't you split the file into relatively large chunks, find the nearest newline to the chunk points, re-split on those positions, and use that division of labor?
- diroussel 13y agoYes, that is a good approach, and it was used in some of the faster implementations of Tim Bray's Wide Finder competition. http://www.tbray.org/ongoing/When/200x/2007/09/20/Wide-Finder http://www.tbray.org/ongoing/When/200x/2007/09/20/Wide-Finde...