I was curious to find how fast or slow Encode is against popular Japanese transcoder modules. So I benchmarked and relieved that Encode's performance was good!
I benchmarked it against Jcode.pm (mine, too) and jcode.pl (the first and still popular transcoder available since Perl4 by Utashiro-san) and here is the result. Except for 7bit-jis (ISO-2022) <-> euc-jp Encode performed the best. And even for those losing against Jcode.pm, performance loss is not that big. Note Unicode conversion tests are missing from jcode.pl because they are unimplemented thereby. The Japanese has one more good reason to switch to Perl 5.8. Dan the Encode Maintainer. ==== 7bit-jis -> euc-jp ==== Rate Encode jcode.pl Jcode.pm Encode 69.6/s -- -16% -40% jcode.pl 83.1/s 19% -- -29% Jcode.pm 116/s 67% 40% -- ==== 7bit-jis -> shiftjis ==== Rate Jcode.pm jcode.pl Encode Jcode.pm 14.6/s -- -9% -80% jcode.pl 16.0/s 9% -- -78% Encode 71.9/s 393% 351% -- ==== 7bit-jis -> ucs2 ==== Rate Jcode.pm Encode Jcode.pm 48.3/s -- -26% Encode 65.3/s 35% -- ==== 7bit-jis -> utf8 ==== Rate Jcode.pm Encode Jcode.pm 31.9/s -- -63% Encode 86.5/s 171% -- ==== euc-jp -> 7bit-jis ==== Rate jcode.pl Encode Jcode.pm jcode.pl 45.9/s -- -32% -60% Encode 67.7/s 48% -- -41% Jcode.pm 114/s 149% 69% -- ==== euc-jp -> shiftjis ==== Rate Jcode.pm jcode.pl Encode Jcode.pm 16.8/s -- -16% -92% jcode.pl 20.0/s 19% -- -90% Encode 206/s 1129% 931% -- ==== euc-jp -> ucs2 ==== Rate Jcode.pm Encode Jcode.pm 85.3/s -- -47% Encode 160/s 87% -- ==== euc-jp -> utf8 ==== Rate Jcode.pm Encode Jcode.pm 44.9/s -- -89% Encode 400/s 791% -- ==== shiftjis -> 7bit-jis ==== Rate Jcode.pm jcode.pl Encode Jcode.pm 13.3/s -- -7% -81% jcode.pl 14.2/s 7% -- -80% Encode 70.7/s 434% 397% -- ==== shiftjis -> euc-jp ==== Rate Jcode.pm jcode.pl Encode Jcode.pm 15.1/s -- -25% -93% jcode.pl 20.1/s 33% -- -90% Encode 210/s 1285% 943% -- ==== shiftjis -> ucs2 ==== Rate Jcode.pm Encode Jcode.pm 12.8/s -- -93% Encode 175/s 1270% -- ==== shiftjis -> utf8 ==== Rate Jcode.pm Encode Jcode.pm 11.2/s -- -98% Encode 512/s 4456% -- ==== ucs2 -> 7bit-jis ==== Rate Jcode.pm Encode Jcode.pm 61.8/s -- -1% Encode 62.4/s 1% -- ==== ucs2 -> euc-jp ==== Rate Jcode.pm Encode Jcode.pm 138/s -- -9% Encode 151/s 9% -- ==== ucs2 -> shiftjis ==== Rate Jcode.pm Encode Jcode.pm 14.9/s -- -91% Encode 162/s 989% -- ==== ucs2 -> utf8 ==== Rate Jcode.pm Encode Jcode.pm 33.3/s -- -87% Encode 267/s 700% -- ==== utf8 -> 7bit-jis ==== Rate Jcode.pm Encode Jcode.pm 59.5/s -- -18% Encode 72.7/s 22% -- ==== utf8 -> euc-jp ==== Rate Jcode.pm Encode Jcode.pm 129/s -- -44% Encode 233/s 80% -- ==== utf8 -> shiftjis ==== Rate Jcode.pm Encode Jcode.pm 14.7/s -- -94% Encode 261/s 1673% -- ==== utf8 -> ucs2 ==== Rate Jcode.pm Encode Jcode.pm 50.6/s -- -74% Encode 191/s 278% --