Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3313604
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:08:04+00:00 2026-05-17T22:08:04+00:00

Besides ruby-prof and and the core Benchmark class, what do you use to profile

  • 0

Besides ruby-prof and and the core Benchmark class, what do you use to profile your Ruby code? In particular, how do you find the bottlenecks in your code? It almost feels like I need to work on my own little tool just to figure out where all the time is being spent in my code.

I realize ruby-prof provides this, but the output is frankly very confusing and doesn’t make it easy to find out which actual blocks of your own code are the source of the issue (it tells you about which method calls took the most time though). So I’m not really getting as much out of it as I’d like, and haven’t really been able to make use of it.

Perhaps I’m doing it wrong? Are there alternatives? Google searches don’t bring up anything for me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:08:05+00:00Added an answer on May 17, 2026 at 10:08 pm

    Lots of profilers are like that.
    What you need to know is not where the program spends its time, but why. Any references on Dynamic Code Analysis?

    ADDED: Here’s how I find “bottlenecks” in my code. (I hate that word.)
    Here’s a list of reasons why.

    It is perfectly natural to assume that to find “bottlenecks” you have to somehow do a lot of measuring.
    It is so natural that nearly all profilers are based on it.

    Actually, finding and measuring are not the same problem. Measuring is needed to see if what you found (and fixed) made a difference. Finding what to fix, to me, is more like debugging than measuring.

    The simplest way to explain it is to start from an infinite, or nearly infinite loop. How do you find it? You pause it and look at the stack, right? because you know the problem is somewhere on the stack. You only need to pause it once, and then you need to study the code on the stack. Pause it a few times if you want to be sure you’ve found it.

    Suppose the code only takes twice as long as necessary. That means when you pause it, there is a 50% chance you will see it doing the unnecessary thing. If you pause it and look at it 10 times, you will catch it in the act roughly 5 times. In fact, as soon as you see it doing something you can optimize on as few as 2 samples, you’ve found a “bottleneck”. Fix it, measure the speedup, show it off, and repeat.

    Even if your biggest problem is not very big, this method will eventually find it.
    Also, there’s a magnification phenomenon, where small problems become easier to find after you’ve removed larger ones. That allows you to keep going until the code is nearly optimal.

    P.S. After you’ve done this, there may still be opportunities for speedup. For example, optimization algorithms can depend on numerical stability. Message-driven architectures can make it harder to trace why code is being executed. In real-time software, a performance problem may only happen occasionally, and be less easy to sample. This requires more cleverness. Falling back on just measuring doesn’t do it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Besides just using yield for iterators in Ruby, I also use it to pass
Besides open-sourcing your project and legislation, are there ways to prevent, or at least
I'm using the Highrise API and Ruby wrapper, but my problem is that (besides
C++: for(i=0,j=0;i<0;i++,j++) What's the equivalence to this in ruby? Besides the normal for ,
What revision control do you use that works best for windows besides Git and
I have two classes that are almost identical, besides one method. The classes have
I have some Ruby code that uses protected level attr_readers to be able to
What script engine do you use/know for server side scripting besides: Delphi Web Script
I cannot find much advantage in them besides kind of documentation purpose. Python will
Besides the dynamic nature of Python (and the syntax), what are some of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.