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 which seems to work fine on 1.9.2, but the memory allocation requires a patched ruby interpreter and I can only find patches for ruby 1.8. Is there a ruby profiler out there that does the job?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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
.