hoodwink.d enhanced


Mauricio Skips Recursion With YARV's Hidden Levels! #

by why in inspect

Mauricio’s found some CFLAGS in YARV which will power-up the opcodes to give Ruby a highly swift route through recursion. He runs an Ackermann on Ruby HEAD for a time of 1.815 seconds, compared with St. Valentine’s YARV which clocks in at 0.027. (Note that he’s including a 0.02 sleep!)

I’m dying for Nintendo Power to put out a big fold-out map of YARV opcodes and cheats. Anyway, be sure to check the leftmost column of ko1’s map before telling Slashdot that Ruby is leaving streak marks everywhere, lest we become the new heirs to Alex Chiu. You can’t see it, but I am winking.

said on 16 Feb 2006 at 16:03

< A clever optimizations indeed. Just the same, my hopeful heart was searching for some sort of tail-recursion dealie. Maybe Santa will bring it.)

said on 16 Feb 2006 at 16:13

Yes, tail recursion is the sauce.

said on 16 Feb 2006 at 16:23

Hmm. Actually I think many of these opcodes could—potentially—be used in a tail position.

Probably shouldn’t be looking for tail-recursive versions of individual opcodes.

It’s possible there is something in the structure of the instruction stream itself that would allow the interpreter to identify tail calls.

said on 16 Feb 2006 at 16:33

Double-checking some YARV disassembly, all tail ops are followed by end, so there’s nothing stopping the VM from doing a one-opcode lookahead to decide on a tail call or not.

said on 16 Feb 2006 at 19:55

what? i get a new job and am away from my ruby blogs for a week and they already get a VM? man…

said on 16 Feb 2006 at 19:59

well, yeah, great, haha, etc but YARV actually was faster out-of-the-box for my code. yay. maybe i can figure out how to make it even faster.

said on 17 Feb 2006 at 09:13

Looks like Java is now officially obsolete!

said on 17 Feb 2006 at 21:41

I remember ko1 collecting the “computer language shootout” ruby submissions to test Yarv. I know about the whole controversy surrounding that benchmark, but would like to see how Yarv does anyways ; ). In any case, there’s two entries for python as well, CPython and Python Psyco. Somebody notify the people over at http://shootout.alioth.debian.org/ there’s a new player in town.

said on 23 Feb 2006 at 14:51

“Somebody notify the people over at”

That would be a feature request, but there’s too much alpha and beta stuff – so we’d wait for proper release. http://shootout.alioth.debian.org/faq.php#report

Incidentally, we combined the naive recursive algorithms, see http://shootout.alioth.debian.org/gp4/benchmark.php?test=recursive&lang=all

Shame no one’s contributed a Ruby implementation.

said on 27 Mar 2006 at 16:04

I finally found a decent YARV test case among my scripts (parsing 3.300 small XML files with REXML ) and documented it here— not as impressive as the test results at eigenclass, but still faster than interpreted Ruby.

Comments are closed for this entry.