On Fri, 05 Aug 2016 22:51:16 +0900 Norihiro Tanaka wrote: > Hi, > > We can speeds up sed by caching result of result mbrtowc() for single > byte characters. It is effective especially in non-UTF8 multibyte > locales which is expensive calculatation. > > $ yes $(printf %040d 0) | head -1000000 >k > > Before: > > $ time -p env LC_ALL=ja_JP.eucjp sed/sed -ne /a.b/p k > real 1.93 > user 1.61 > sys 0.27 > > After patching > > $ time -p env LC_ALL=ja_JP.eucjp sed/sed -ne /a.b/p k > real 0.46 > user 0.42 > sys 0.03 > > Thanks, > Norihiro I rewrote the patch as using localeinfo in gnulib.