the blog
Back to -Blog

Fast Ruby Debugger - Enter Cylon

Some preliminary results from our new fast debugger.
by Dermot Hogan
Friday 27 October 2006.

I’ve been working on the new Ruby In Steel debugger and I’ve now got some results. The debugger is called ‘Cylon’ – the reasons being...

- it’s shorter to say than ‘fast Ruby debugger’
- I saw a superb Microsoft advertisement so time ago. The text just read: “Cylons. Why debugging matters. Use Visual Studio!”. After that, what else could I call it?


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.

Bookmark and Share   Keywords:  development
  • Fast Ruby Debugger - Enter Cylon
    30 January 2007, by Happy one

    Downloaded a trial version and did some test for the debugger performance. Running the given example under the Cylon at least 2.5 times slower than running under standard Ruby. I don’t know where did you get this 20% number.

    • Fast Ruby Debugger - Enter Cylon
      31 January 2007, by Huw

      We’ve just run a whole bunch of tests all over again and Dermot’s written a new article which shows the results.

      http://www.sapphiresteel.com/More-Cylon-benchmarks

      We can’t reproduce the slower timings that you report. If you can provide any clues as to what may be the cause of these, please let us know.

      best wishes

      Huw

  • Fast Ruby Debugger - Enter Cylon
    7 November 2006

    Very cool - I’m finding the lack of intellisense (or similar in my editor of choice, SlickEdit) and a real debugger to be a significant productivity lag against (but not greater than) Ruby’s many productivity advantages when compared to C#, and I’m very glad to see your apparently very serious attempt to close this gap.

    • Fast Ruby Debugger - Enter Cylon
      8 November 2006, by Huw

      Yes, we are :-)

      You might be interested to know that we’ll be putting a lot more information onto the web site over the next few weeks (feature lists, screenshots, ’in depth’ technical articles, movies showing the Developer Edition in action etc.) which should help to clarify exactly how the new Cylon debugger and all our IntelliSense features actually work.

      best wishes

      Huw

© SapphireSteel Software 2013