ついでにerubyと比較
驚きの結果が出た。
Ruby/SALTのほうのベンチマークプログラム - vs_eruby.rb
require "salt" #テンプレートの読み込み t = "" open("yahoo.html", "r") do |fh| t = fh.read end s = Salt.new(t) s.render
erubyに食べさせるのは、yahoo.htmlファイルそのまんま。
両者をbashのtimeで計測。
$ time ruby vs_eruby.rb > /dev/null real 0m0.025s user 0m0.012s sys 0m0.012s
$ time eruby yahoo.html > /dev/null real 0m0.046s user 0m0.036s sys 0m0.012s
erubyより速くなっちゃった!
ちなみにPHP 5.0.5
$ time php yahoo.html > /dev/null real 0m0.235s user 0m0.212s sys 0m0.024s