|.: Make grep 50x faster|
Found this neat trick in Brendan Gregg's Blazing Performance with Flame Graphs talk.
Switching to LANG=C improved performance by 2000x
In a quick test I directly got a performance gain of factor 50.22.
This is quite an achievement for only changing one environment variable.
real:~# du -sh /var/log/querylog
real:~# time grep -i e /var/log/querylog > /dev/null
real:~# time LANG=C grep -i e /var/log/querylog > /dev/null
I suspect that the performance gain may vary quite a lot depending on the search pattern.
Also, please note that this trick only works when you know that the involved files and search patterns are ASCII only.
(via Standalone Sysadmin)