Is there a way to profile ruby 1.9.2 scripts with memory allocation reports?

前端 未结 1 1052
深忆病人
深忆病人 2020-12-30 09:50

I\'m running into bottlenecks in my ruby application, but I can\'t figure out where it\'s slowing down. I found memprof, but it doesn\'t support 1.9. I also found ruby-prof

相关标签:
1条回答
  • 2020-12-30 10:25

    Have you tried profiling the GC? Ruby 1.9.2 includes GC::Profiler.

    GC::Profiler.enable
    GC.start
    puts GC::Profiler.report
    

    You may also want to look at ObjectSpace.count_objects.

    0 讨论(0)
提交回复
热议问题