This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bash-3.2$ ruby -v | |
ruby 1.9.3dev (2010-10-28 trunk 29618) [i386-cygwin] | |
bash-3.2$ ytl -v | |
ytl 0.0.4 (ytljit 0.0.8) | |
Open failed 2 handlebash-3.2$ date | |
Thu Sep 22 23:11:21 2011 | |
bash-3.2$ rake bench | |
user system total real | |
bm_so_binary_trees.rb | |
ytl 18.720000 1.682000 20.417000 ( 20.944000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PHI = (Math.sqrt(5.0) + 1) / 2 | |
def rfib(a) | |
la = Math.log(a) | |
lp = Math.log(PHI) | |
l5 = Math.log(Math.sqrt(5.0)) | |
(la + l5) / lp | |
end | |
(1..100).each do |i| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PHI = (Math.sqrt(5.0) + 1) / 2 | |
def rfib(a) | |
l5 = Math.log(Math.sqrt(5.0)) | |
la = Math.log(a - (1 / Math.sqrt(5.0))) | |
lp = Math.log(PHI) | |
(la + l5) / lp | |
end | |
(1..10000).each do |i| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Threadクラス (Rubyのとは違うので名前を替えたほうがいいか?) | |
クラスメソッド | |
new スレッドを作成する。ブロックを渡し、作成したスレッドでブロックを実行する。 | |
Thread.newを実行したselfをコピーしブロックはそのselfを使う。 | |
つまり、インスタンス変数を使用しても親スレッドとは競合しない。 | |
Threadクラスのインスタンスを返す | |
インスタンス変数 | |
join スレッドの実行を待ち合わせする。子スレッドが終了したらmerge処理を行う。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
難ぬ落ち 天人日まで 寺の眉 丁ち良そこ 鐘折るく壁 | |
駒や春 山々日くれ 塔ふはく 客人ころ 枯木日かよわ | |
埴輪だの 安ところども 歩余とだに 悪名良笛 げ以上居る | |
すそちそぎ 行方どぽしん がくぬかた 覚日もつき 時ばかりや染 | |
路わ都もん 机で似かね 藻のうすぎ 華ながらすら ルビべにお乗り | |
陰ぜせき 赤城日名だの 蚊ようほど 詩たのむ良なう 逸だけ師なう | |
伝日だけ 鶯ノふり 尾日ぽづら 日記ぽを焼き 朝染め斗のう | |
柴露より 静楽ゐゆけ 清水いに 埴輪やいしも 河原日のうそ | |
眼斗日やら しん間ど寝てく 隙日くれ 王城こと 語ながら木君 | |
ふみ出華 盥しも〇 ゆへるおと 芙蓉日に人 紅梅て養 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/ruby | |
# This program is contributed by Shin Nishiyama | |
# modified by K.Sasada | |
NP = 5 | |
ROW = 8 + NP | |
COL = 8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# AO render benchmark | |
# Original program (C) Syoyo Fujita in Javascript (and other languages) | |
# http://lucille.atso-net.jp/blog/?p=642 | |
# http://lucille.atso-net.jp/blog/?p=711 | |
# Ruby(yarv2llvm) version by Hideki Miura | |
# | |
IMAGE_WIDTH = 256 | |
IMAGE_HEIGHT = 256 | |
NSUBSAMPLES = 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rdat(Fn) :- see(Fn), | |
readln([X0]), | |
assert(pasta(X0)), | |
readln([X1]), | |
assert(pasta(X1)), | |
readln([X2]), | |
assert(pasta(X2)), | |
readln([X3]), | |
assert(juice(X3)), | |
readln([X4]), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# AO render benchmark | |
# Original program (C) Syoyo Fujita in Javascript (and other languages) | |
# http://lucille.atso-net.jp/blog/?p=642 | |
# http://lucille.atso-net.jp/blog/?p=711 | |
# Ruby(yarv2llvm) version by Hideki Miura | |
# | |
IMAGE_WIDTH = 256 | |
IMAGE_HEIGHT = 256 | |
NSUBSAMPLES = 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user system total real | |
bm_so_binary_trees.rb | |
ytl 17.377000 6.036000 23.585000 ( 37.127000) | |
ytl compile 2.308000 5.615000 7.939000 ( 19.806000) | |
ytl unboxed 7.346000 6.269000 13.646000 ( 26.070000) | |
ruby 58.343000 2.011000 60.384000 ( 78.321000) | |
user system total real | |
bm_so_matrix.rb | |
ytl 3.478000 5.740000 9.234000 ( 19.361000) | |
ytl compile 2.682000 5.677000 8.375000 ( 18.128000) |