среда, 25 января 2012 г.

Simple ruby profiling

Just run ruby script with -rprofile option.
For example:
>ruby -rprofile script.rb
% cumulative self self total
time seconds seconds calls ms/call ms/call name
74.73 9.51 9.51 20 475.60 1271.40 IO#each_line
13.38 11.21 1.70 448096 0.00 0.00 String#=~
11.78 12.71 1.50 448129 0.00 0.00 Fixnum#+
0.12 12.73 0.02 8 1.88 1.88 IO#write
0.00 12.73 0.00 2 0.00 0.00 IO#set_encoding
0.00 12.73 0.00 22 0.00 0.00 String#==
0.00 12.73 0.00 22 0.00 0.00 BasicObject#!=
0.00 12.73 0.00 57 0.00 0.00 Array#[]
0.00 12.73 0.00 22 0.00 0.00 Array#first
0.00 12.73 0.00 22 0.00 0.00 String#split
0.00 12.73 0.00 2 0.00 6357.00 IO#open
0.00 12.73 0.00 19 0.00 0.00 IO#rewind
0.00 12.73 0.00 1 0.00 0.00 IO#close
0.00 12.73 0.00 4 0.00 0.00 Fixnum#to_s
0.00 12.73 0.00 2 0.00 0.00 File#initialize
0.00 12.73 0.00 2 0.00 7.50 Kernel.print
0.00 12.73 0.00 1 0.00 12729.00 #toplevel

Комментариев нет:

Отправить комментарий