Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Trie impl is slower on JRuby than other Rubies #426
We run it slower then either 1.9.3 or Rubinius, so something's broken:
Charles, you might also want to check out the more stressing previous, naive implementation where the used letters are passed as arguments rather than set in a fixed instance variable to receive from during the recursion. JRuby has some strange behavior here, where it runs the first test slower than MRI and then for the next tests, it's much faster. Try running it a couple of times with different tests and different order of tests, and you'll see this in effect.
Grrr... something WAS broken: me.
It turns out the benchmark uses enough memory on JRuby that it hits our 500MB cap. As a result, it starts doing full GC runs, skewing results badly.
With 1000MB heap cap, we're easily the fastest:
I also ran the original more object and GC-heavy version. We're the fastest there too (by an even greater margin).
Long live JRuby!