NOTE: For more recent articles relating to Cylon, see:
Ruby Debugger Timings
Ruby In Steel Developer - Overview
If you aren’t into watching television after a hard day on a PC, look here. And no jokes about toasters, please.
The key points about Cylon are:
it’s fast. Really FAST! Cylon imposes an overhead of about 15-20% over the standard Ruby interpreter compared to an overhead of over 100 times for the standard Ruby debugger.
you don’t need a modified Ruby interpreter. It works with the standard Ruby interpreter.
Results
The first benchmark I ran used a simple counter:
0.upto(10000000) {count += 1}
This took 6.25 seconds without any debugger present. Using the current Ruby In Steel debugger (in the free ’personal edition’) it took 857 seconds, slightly better than the standard Ruby debugger which came in at a ‘like-watching-paint-dry’ 876 seconds. And using Cylon: 7.38 seconds.
The second benchmark I ran tested calls – repeated calls to a factorial function. It’s not particularly realistic, but it is the other extreme of the linear code example above: most benchmarks will be somewhere between the two. Here’s the code:
def fac(n)
lvar = n
n == 1 ? 1 : n * fac(n-1)
end
0.upto(10000) {fac(50)}
This took 2.30 seconds without any debugger, 2.66 seconds with Cylon – and 350 seconds with the Ruby debugger. I didn’t run it on the Ruby debugger with an iteration count of 100000 for obvious reasons (I just don’t have that much free time to spare!).
I’ve presented the results in a table below using the original Ruby debugger, debug, for comparison. There’s a couple of points:
first, no breakpoints were used. Adding breakpoints slows Cylon down but not very much. Cylon copes quite well because it uses an intelligent search algorithm, whereas the Ruby debugger use a linear seach of a Ruby array - and the performace simply falls off the end of a cliff
secondly, the benchmarks are very simple. They only give an indication of what’s going on
thirdly, I’m still working on optimising and adding new features to Cylon. I’ll publish some more benchmarks when I’m completely done.
Table of Benchmark Results
Benchmark #1 (linear)
| Iterations | no debug | Cylon | debug.rb |
| 100000 | 0.06 | 0.08 | 8.6 |
| 1000000 | 0.66 | 0.81 | 87.4 |
| 10000000 | 6.25 | 7.38 | 876 |
Benchmark #2 (recursive)
| Iterations | no debug | Cylon | debug.rb |
| 100 | 0.02 | 0.02 | 3.11 |
| 1000 | 0.23 | 0.27 | 31.1 |
| 10000 | 2.30 | 2.66 | 352 |
| 100000 | 22.63 | 25.81 | |
To sum up, running Cylon in a simple scenario gives around a 15-20% performance hit. Compare this to the Ruby debugger – the performance is typically over ONE HUNDRED TIMES worse. That’s two orders of magnitude greater than the original.
We think that Cylon is currently the fastest Ruby debugger around – by a substantial amount too. And did I mention that you don’t need a hacked Ruby interpreter? Hmm, maybe I did – but I’ll repeat it: Cylon does not required a modified Ruby interpreter.
Benchmark code
Here’s a screenshot of the benchmark code. I ran it on a 2.8GHz Intel machine with 1.5GB of memory.
The Cylon Debugger is part of the Developer Edition of Ruby In Steel. This edition will be released in January 2007.