rblineprof

line-profiler for ruby

  • 所有者: tmm1/rblineprof
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

rblineprof

Installation

gem install rblineprof

Or in your Gemfile:

gem 'rblineprof'

Usage

require 'rblineprof'

profile = lineprof(/./) do
  sleep 0.001

  100.times do
    sleep 0.001

    1*2*3
    4*5*6
    7*8*9*10*11*12*13*14*15
    2**32
    2**128
  end
end

file = profile.keys.first

File.readlines(file).each_with_index do, line, num, wall, cpu, calls, allocations = profile[file][num + 1]

  if wall > 0, cpu > 0, calls > 0
    printf(
      "% 5.1fms + % 6.1fms (% 4d), %s",
      cpu / 1000.0,
      (wall - cpu) / 1000.0,
      calls,
      line
    )
  else
    printf ", %s", line
  end
end

Will give you:

  0.1ms +    1.4ms (   1), sleep 0.001, 2.7ms +  132.2ms (   1), 100.times do
  1.3ms +  131.7ms ( 100), sleep 0.001, 1*2*3, 4*5*6, 7*8*9*10*11*12*13*14*15
  0.1ms +    0.1ms ( 100), 2**32
  0.6ms +    0.1ms ( 100), 2**128, end, end, file = profile.keys.first, File.readlines(file).each_with_index do, line, num, wall, cpu, calls, allocations = profile[file][num + 1], if wall > 0, cpu > 0, calls > 0, printf(, "% 5.1fms + % 6.1fms (% 4d), %s",, cpu / 1000.0,, (wall - cpu) / 1000.0,, calls,, line, ), else, printf ", %s", line, end, end

Rails integration

Other profilers

License

rblineprof is released under the MIT License.

主要指标

概览
名称与所有者tmm1/rblineprof
主编程语言C
编程语言Ruby (语言数: 2)
平台
许可证MIT License
所有者活动
创建于2012-09-10 09:41:11
推送于2024-04-12 08:32:18
最后一次提交2016-10-30 10:46:57
发布数2
最新版本名称v0.3.6 (发布于 )
第一版名称v0.3.3 (发布于 )
用户参与
星数771
关注者数22
派生数35
提交数121
已启用问题?
问题数11
打开的问题数4
拉请求数15
打开的拉请求数2
关闭的拉请求数6
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?