line-profiler for ruby
C Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
ext
test
.gitignore ignore file Jan 1, 2014
Gemfile
Gemfile.lock rake-compiler Jan 17, 2014
LICENSE
README.md
Rakefile add Rakefile and Gemfile Jan 1, 2014
rblineprof.gemspec v0.3.7 Jul 13, 2016
test.rb

README.md

rblineprof

% ruby -C ext extconf.rb
% make -C ext
% ruby test.rb 
           | $:.unshift 'ext'
           | require 'rblineprof'
           | 
           | profile = lineprof(/./) do
     1.2ms |    sleep 0.001
           | 
     0.1ms |    100.times do
           | 
   119.6ms |      sleep 0.001
     0.7ms |      1*2*3
     0.2ms |      4*5*6
     0.4ms |      7*8*9*10*11*12*13*14*15
     0.2ms |      2**32
     1.4ms |      2**128
           | 
           |   end
           | end
           | 
           | File.readlines(__FILE__).each_with_index do |line, num|
           |   if (sample = profile[__FILE__][num+1]) > 0
           |     printf "% 8.1fms |  %s", sample/1000.0, line
           |   else
           |     printf "           | %s", line
           |   end
           | end

Rails integration

Other profilers

License

rblineprof is released under the MIT License.