カテゴリ別 2003年 | 2004年 | 2005年 | 2006年 | 2007年 | 2008年
知り合いサイト: よんだもの / 暴想 / Linuxでやる夫 / 新宿Vipper / 僕だけが幸せになればいいのに。
ruby2.0 の VM 予定である YARV の完成度が高まっており、rails が動作したとの報告もあります。
YARV 0.3.0 がリリースされたときに引き続いて、Computer Language Shootout のいくつかのベンチマークプログラムについて、以下の処理系で time をとってみました。
Linux version 2.4.26-gentoo-r9 $ ruby18 -v ruby 1.8.4 (2005-12-24) [i686-linux] $ ./yarv -v ruby 1.9.0 (2006-02-14) [i686-linux] YARVCore 0.3.3 (rev: 453) [opts: ] $ ./yarv-opt -v ruby 1.9.0 (2006-02-14) [i686-linux] YARVCore 0.3.3 (rev: 453) [opts: [direct threaded code] [optimize basic operation] [stack caching] [operands unification] [instructions unification] [inline method cache] [block inlining] ] $ perl -v This is perl, v5.8.7 built for i686-linux
コンパイルオプションはどれも CFLAGS="-O2 -march=athlon-xp -pipe -fomit-frame-pointer" です。
では早速結果を。一番速かったものを赤字にしています。
| 処理系 | binarytrees | 比 | mandelbrot | 比 | nsieve | 比 | nsieve-bits | 比 | nbody | 比 | fannkuch | 比 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ruby 1.8.4 | 346.398s | 1.00 | 109.203s | 1.00 | 80.918s | 1.00 | 180.942s | 1.00 | 460.031s | 1.00 | 359.573s | 1.00 |
| YARV rev453 | 220.196s | 0.64 | 61.439s | 0.56 | 39.964s | 0.49 | 69.387s | 0.38 | 239.649s | 0.52 | 299.175s | 0.83 |
| YARV rev453(最適化) | 502.971s | 1.45 | 32.127s | 0.29 | 32.562s | 0.40 | 56.513s | 0.31 | 234.752s | 0.51 | 268.312s | 0.75 |
| perl 5.8.7 | 333.649s | 0.96 | 32.653s | 0.30 | 48.932s | 0.60 | 40.589s | 0.22 | 328.495s | 0.71 | 281.067s | 0.78 |
最適化オプションをたっぷりつけた YARV ですと binarytrees が遅くなるという現象がありましたが、perl といい勝負になっていますね(というかうちの環境だと perl が遅い?)。
最近のコメント:
RSS
![]()
This work is licensed under a
Creative Commons License
(note: text only. w/o web design, citations, (re)distributed softwares).
おお,すばらしい>評価<br><br>stack caching はでかいプログラムでは切っておいたほうがいいかも.この辺はちょっと(ごにょごにょ)<br><br>Computer Language Shootoutは,Ruby が遅い方法使っていたりと,なかなか侮れない(Perl や Python 使いは,なんか速いの使っていたり)ので,もしかしたらその辺に理由があるのかもしれません,などと陰謀論.<br><br>ところで,これらのベンチマーク,YARV のベンチマーク集(yarv/benchmark)にコミットしませんか? :)
ふむふむ。今度はstack caching切って試してみます。<br>コミットですか?Shootoutのコードを実行してるだけですけども。。。<br>それとも、ベンチマーク結果のページってあるのでしたっけ。