the blog
Back to -Blog

Ruby Debugger Timings

by Dermot Hogan
Wednesday 30 January 2008.

Here are the results of some simple benchmarks comparing the three Ruby debuggers - the original slow Ruby debugger, ruby-debug and Cylon.

As I mentioned last week there are two main types of benchmark tracing that Ruby provides. One traces a ‘line’ execution and the other traces a ‘call’ invocation. For ‘line’ based code (such as i = i + 1), the tracing overhead is the same for all lines. For the other ‘call’ trace, the overhead varies a bit depending on the number of local variables, etc. But it’s always a good bit more expensive that the simple ‘line’ trace.

The two benchmarks I’ve constructed are designed to measure the ‘line’ based performance and the ‘call’ based performance reasonably independently. They are very simple but do give a good indication of the relative efficiency of the various debuggers;

I’ve run the benchmarks with two parameters. The first is with/without saving the stack frames. If you don’t save the stack frames, you don’t get call stack navigation (which seems to me to reduce the usefulness of the debugger a whole lot). However, be aware that ruby-debug runs by default with no stack frame saving, while Cylon runs by default with stack frame saving turned on. The second is with/without breakpoints. I used 4, but for Cylon it doesn’t really matter how many breakpoints you use after the first one – the time is pretty much the same.

There’s one other thing to be aware of: with Cylon, you can enter a breakpoint at any time. You don’t have to be stopped at a breakpoint or otherwise halted to insert one.

The results

Line based, no breakpoints,stack frames on
Ruby (no debug) Cylon C-debug slow Ruby debug
8.5 10.7 19.9 1750
Line based, 4 breakpoints, stack frames on
Ruby (no debug) Cylon C-debug slow Ruby debug
8.5 14.3 22.51 2480
Call based, no breakpoints, stack frames on
Ruby (no debug) Cylon C-debug slow Ruby debug
4.6 18.7 31.4 1210
Call based, 4 breakpoints, stack frames on
Ruby (no debug) Cylon C-debug slow Ruby debug
4.6 21.9 34.4 1820
Call based, no breakpoints, stack frames off
Ruby (no debug) Cylon C-debug slow Ruby debug
4.6 6.1 11.3 1210

The benchmark code


The timings were made with the version of Cylon that will be released shortly in Ruby In Steel Developer 1.2 and these may be slightly different (better) than timings made with earlier releases of Cylon. Note that the fast Cylon debugger is provided with the Developer Edition only; the Text Edition has a slower debugger.

Bookmark and Share   Keywords:  debugger
© SapphireSteel Software 2013