I found that grep -Fw is extremely slow in spite of whether in multibyte locales or not. $ yes 'abcdefg hijklmn opqrstu vwxyz' | head -100000 >k $ time -p env LC_ALL=C grep -Fw vwxy k real 14.03 user 12.51 sys 0.74 $ time -p env LC_ALL=ja_JP.eucJP grep -Fw vwxy k real 14.29 user 12.67 sys 0.50 $ time -p env LC_ALL=C grep -w vwxy k real 0.11 user 0.01 sys 0.09 $ time -p env LC_ALL=ja_JP.eucJP grep -w vwxy k real 0.89 user 0.71 sys 0.15 First patch fixes the problem. Second patch changes as using grep matcher for grep -Fw in single byte locales. In single byte locales, DFA (not regex) is also used for words matching, and it is very fast as above result.