-
Some nice performance tricks; I particularly like the use of sljit:
Ag uses Pthreads to take advantage of multiple CPU cores and search files in parallel. Files are mmap()ed instead of read into a buffer. Literal string searching uses Boyer-Moore strstr. Regex searching uses PCRE's JIT compiler (if Ag is built with PCRE >=8.21). Ag calls pcre_study() before executing the same regex on every file. Instead of calling fnmatch() on every pattern in your ignore files, non-regex patterns are loaded into arrays and binary searched.
jit cli grep search ack ag unix pcre sljit boyer-moore tools
Richard Stallman's GNU Manifesto Turns Thirty
nice New Yorker profile of rms
-
Thought-provoking article looking back to John Perry Barlow's "A Declaration of the Independence of Cyberspace", published in 1996:
Barlow once wrote that "trusting the government with your privacy is like having a Peeping Tom install your window blinds." But the Barlovian focus on government overreach leaves its author and other libertarians blind to the same encroachments on our autonomy from the private sector. The bold and romantic techno-utopian ideals of "A Declaration" no longer need to be fought for, because they're already gone.
john-perry-barlow 1990s history cyberspace internet surveillance privacy data-protection libertarianism utopian manifestos
The Terrible Technical Interview
TechCrunch, very down on the traditional big-O-and-whiteboard tech interview. See also https://news.ycombinator.com/item?id=9243169 for some good comments at HN. To be honest I think a good comprehension of data structures and big-O is pretty vital though....
#
I'd still bet that ag is slower and much more complicated than findrepo which is more UNIXy in that it reuses existing commands rather than reimplementing them
handbags at dawn! ;)
I'd be curious about that tbh. I like the use of sljit-compiled regexps, but yeah, one thing that hacking on SpamAssassin body-regexp performance taught me is that even speeding up performance of the main hotspot by 50% can be eclipsed by the effects of the fundamental I/O and OS work required to perform the job.
tbh, if you want to get most of the same speedups, you can just use grep -P, which has used the PCRE JIT for some three years now. Likewise 'git grep -P". 'git grep' does not use the JIT, but its multithreaded nature makes it blindingly fast anyway on stuff that's in cache.
Nix: thanks, good tips