てきとうなメモ

本の感想とか技術メモとか

grep 2.17

10倍速くなったとあるけど、

grep -i in a multibyte locale is now typically 10 times faster
for patterns that do not contain \ or [.

grep-2.17 released - LWN.net

マルチバイトのロケールで-iを使った時の検索が速くなるという話。

さらに、

The trick is to realize that for some search strings, it is easy
to convert to an equivalent one that is handled much more efficiently.
E.g., convert this command:

grep -i foobar k

to this:

grep '[fF][oO][oO][bB][aA][rR]' k

Savannah Git Hosting - grep.git/commit

とあるので、無駄に遅くなっていた部分を速くしたということかな