I ran ruby-profiler on one of my programs. I'm trying to figure out what each fields mean. I'm guessing everything is CPU time (and not wall clock time), which is fantastic. I want to understand what the "---" stands for. Is there some sort of stack information in there. What does calls a/b mean?
Thread ID: 81980260 Total Time: 0.28 %total %self total self wait child calls Name -------------------------------------------------------------------------------- 0.28 0.00 0.00 0.28 5/6 FrameParser#receive_data 100.00% 0.00% 0.28 0.00 0.00 0.28 6 FrameParser#read_frames 0.28 0.00 0.00 0.28 4/4 ChatServerClient#receive_frame 0.00 0.00 0.00 0.00 5/47 Fixnum#+ 0.00 0.00 0.00 0.00 1/2 DebugServer#receive_frame 0.00 0.00 0.00 0.00 10/29 String#[] 0.00 0.00 0.00 0.00 10/21 <Class::Range>#allocate 0.00 0.00 0.00 0.00 10/71 String#index -------------------------------------------------------------------------------- 100.00% 0.00% 0.28 0.00 0.00 0.28 5 FrameParser#receive_data 0.28 0.00 0.00 0.28 5/6 FrameParser#read_frames 0.00 0.00 0.00 0.00 5/16 ActiveSupport::CoreExtensions::String::OutputSafety#add_with_safety -------------------------------------------------------------------------------- 0.28 0.00 0.00 0.28 4/4 FrameParser#read_frames 100.00% 0.00% 0.28 0.00 0.00 0.28 4 ChatServerClient#receive_frame 0.28 0.00 0.00 0.28 4/6 <Class::Lal>#safe_call -------------------------------------------------------------------------------- 0.00 0.00 0.00 0.00 1/6 <Class::Lal>#safe_call 0.00 0.00 0.00 0.00 1/6 DebugServer#receive_frame 0.28 0.00 0.00 0.28 4/6 ChatServerClient#receive_frame 100.00% 0.00% 0.28 0.00 0.00 0.28 6 <Class::Lal>#safe_call 0.21 0.00 0.00 0.21 2/4 ChatUserFunction#register 0.06 0.00 0.00 0.06 2/2 ChatUserFunction#packet 0.01 0.00 0.00 0.01 4/130 Class#new 0.00 0.00 0.00 0.00 1/1 DebugServer#profile_stop 0.00 0.00 0.00 0.00 1/33 String#== 0.00 0.00 0.00 0.00 1/6 <Class::Lal>#safe_call 0.00 0.00 0.00 0.00 5/5 JSON#parse 0.00 0.00 0.00 0.00 5/8 <Class::Log>#log 0.00 0.00 0.00 0.00 5/5 String#strip! --------------------------------------------------------------------------------
ruby-prof is a profiler for MRI Ruby. Its features include: Speed - it is a C extension and therefore many times faster than the standard Ruby profiler. Measurement Modes - ruby-prof can measure program wall time, process time, object allocations and memory usage.
Here are the steps to using StackProf: Add the stackprof gem to your Gemfile. Edit your code to call StackProf and save data to the right file. Use stackprof to summarize the reported data from the.
Each section of the ruby-prof output is broken up into the examination of a particular function. for instance, look at the first section of your output. The read_frames method on FrameParser is the focus and it is basically saying the following:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With