Ruby 初心者スレッド Part 21 at TECH
[2ch|▼Menu]
780:730
08/09/09 16:40:58
>>776
どういうメソッドが使われたかはプロファイラを使えばわかるみたいですね。

$ ruby -r profile -e 'test = (0..100000).to_a' % cumulative self self total
time seconds seconds calls ms/call ms/call name
100.00 0.08 0.08 1 80.00 80.00 Range#each
0.00 0.08 0.00 1 0.00 80.00 Enumerable.to_a
0.00 0.08 0.00 1 0.00 80.00 #toplevel
$ ruby -r profile -e 'test = Array.new(100000){|i| i}' % cumulative self self total
time seconds seconds calls ms/call ms/call name
100.00 1.15 1.15 1 1150.00 1150.00 Array#initialize
0.00 1.15 0.00 1 0.00 1150.00 Class#new
0.00 1.15 0.00 1 0.00 1150.00 #toplevel


次ページ
続きを表示
1を表示
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

5493日前に更新/211 KB
担当:undef