WHITELEAF:Kindle応援サイト

KindleでWEB小説を読もう! Narou.rb 公開中

2010-07-02から1日間の記事一覧

:"symbol"

気になったので他のパターンも。JRuby のための計測です。 require "benchmark" def test_symbol(sym) a = sym end Benchmark.bm { |bm| bm.report("(1)") { 10000000.times { test_symbol(:abc) } } bm.report("(2)") { 10000000.times { test_symbol(:"abc…

access hash

Hash をアクセスする際に Fixnum, Symbol, String を使う場合の比較です。Hash ではなく Array を使った結果もつけておきます。 require "benchmark" class Test def initialize @num_table = {} @sym_table = {} @str_table = {} @array = [] 100.times { |…

Server VM でも試してみました。オプションはよくわからないのでかたっぱしから速くなりそうなのを……。--fast はエラーが出てダメでした。 >jruby --server -v -J-Djruby.compile.frameless=true -J-Djruby.compile.position less=true -J-Djruby.compile.th…