hoodwink.d enhanced


YARV is Ruby, It Is, It Really Is #

by why in cult

Koichi has finished committing YARV to Ruby’s trunk. We’re on our way to Ruby 1.9.1. Great work, Ruby-Core!

 $ svn co http://svn.ruby-lang.org/repos/ruby/trunk ruby
 $ autoreconf -ivf
 $ ./configure --prefix=/opt/ruby-trunk
 $ make
 # make install-nodoc

 $ export PATH=/opt/ruby-trunk/bin:$PATH
 $ ruby -v
 ruby 1.9.0 (2007-01-01 patchlevel 0) [i386-freebsd6.0]

Oh, and if you want to install extensions, you’ll need to uncomment them in ext/Setup.

Update: Murphy’s got some informal benchmarks which produce a YARV speed-up chart. Try out this script here. (from [ruby-core:9825])

said on 01 Jan 2007 at 06:28

Man, you don’t sleep? you didn’t party? anyway, good news, doing a checkout right now, thanks for the info! ;-)

said on 01 Jan 2007 at 09:34

These step-by-steps are both fine news reportage and helpful hand-holding. Two features for the price of one post.

said on 01 Jan 2007 at 11:38

Nice. Does YARV have a bytecode compiling/running feature yet?

said on 01 Jan 2007 at 13:16

I’ve heard that writing Ruby fulfills the same purpose for why that sleep fulfills for most other humans.

If he stopped to sleep for 8 hours, he would be incredibly tired. That happened once and they had to resuscitate him by reading the source of delegate.rb aloud.

As a child he also had this same ability. Instead of waking up at night and crying, he woke up and wrote Ruby code.

said on 01 Jan 2007 at 14:06


said on 01 Jan 2007 at 14:58

wheeee !! do we get real threads now ?

said on 01 Jan 2007 at 16:33

Seriously awesome.

said on 01 Jan 2007 at 18:45

It surprises me that this great news has not gotten more awareness. With a smattering of performance concerns clouding Ruby for some observers, I would expect this material speed increase to cause broader celebration.

Maybe it will happen later in the week, or perhaps I am missing a subtle gotcha.

said on 01 Jan 2007 at 19:54

I compared Ruby 1.9 with 1.85, Python 2.4.3, 2.5, Lua 5.1 and PHP5 . See results :)

said on 01 Jan 2007 at 20:26

Paul: I don’t think many people have used YARV yet. In addition, Matz and Koichi have been seriously downplaying their progress this year. Matz called Ruby 2.0 the longest vaporware in open source and Koichi used a slide that read Rite > Parrot ? (level of vaporware). I think they do that to disarm us, but it’s tempting to believe them. And tempting to compare YARV to hot stuff like Rubinius and JRuby based purely on hearsay, without considering that Koichi is one of our quieter friends from Japan.

If I hadn’t used YARV myself and watched this incredible feat by Koichi unfold, I probably woulda taken that bait too. (JRuby and Rubinius are totally incredible feats as well!!)

said on 01 Jan 2007 at 22:19
While I am eager to hop on this groovy VM train, I can’t get it to compile ;_;
gcc -g -O2  -I. -I.  -DRUBY_EXPORT  -c parse.c
parse.y: In function ‘parser_yylex’:
parse.y:6832: warning: assignment makes pointer from integer without a cast
parse.y:6835: error: dereferencing pointer to incomplete type
I get several “dereferencing pointer to incomplete type” errors after that as well.
said on 01 Jan 2007 at 23:16

what a tasty new years treat

_ good work all _
said on 01 Jan 2007 at 23:53

Yarvy yarvy sandbox?

said on 02 Jan 2007 at 08:49

Seems that native threads still aren’t there, are they? I made a test with 3 threads, the second of them blocking, and the third one was stuck waiting for it.

FlashHater, seems that you missed the gperf step on

Make a new checkout and see if it complains. If it does, install gperf and everything will work fine. :-)

said on 02 Jan 2007 at 09:39

How does YARV performance compare to PHP if eAccelerator or one of those other byte-code caches is used?

said on 02 Jan 2007 at 10:37

I don’t see YARVCore with

ruby -v
(and neither do you above). Am I using YARVCore? And if not, how do I use it? There doesn’t seem to be anything out there on compiling to byte code and such. Is it happening automatically? I was expecting to have to compile to byte code then run byte code. Am I crazy?

said on 02 Jan 2007 at 10:59

Compiles great on FC4 . Thanks. [Compiling beats watching football on any New Year’s day.] ;-)

said on 02 Jan 2007 at 11:13

@Rob Muhlestein

Compiling beats watching football on New Year’s Day ??? Then that means you missed this from yesterday game.


said on 02 Jan 2007 at 17:49

@Jaroslaw: Sorry, wasn’t able to reproduce our results on my Mac. Python and PHP are still faster than Ruby here, significantly.

What’s up?

said on 02 Jan 2007 at 19:39

In every test I tried on my 500mhz thinkpad ruby 1.9.0 was slower than 1.8.5…

said on 02 Jan 2007 at 19:40

@murphy: Try 64bit processor and 64bit OS. I had a chat with one person which had Ubuntu 6.0.6 but he used 32bit and its Ruby 1.9 was working much slower. I repeated my test and got the same results. Ruby 1.9 on my 64bit Athlon64 3700+ and 64bit Ubuntu 6.0.6 is faster than Python, PHP and even Lua.

said on 02 Jan 2007 at 21:16

Jaroslaw: Did you compile Python, PHP and Lua yourself on that architecture?

said on 03 Jan 2007 at 02:17

@Jaroslaw Zabiello: That one person was me ;) I now have compiled PHP 5 , Python 2.5 and Ruby 1.9 from source here and Python is here more than twice as fast as Ruby. And PHP is faster too. I don’t think that’s a problem though.

But I must admin that I’m more interested in Rubinius then ruby1.9 since their approach looks a lot better. Reminds me of pypy/rpython.

said on 03 Jan 2007 at 05:21

why: Yes and no. Python 2.4.3 and Lua 5.1 were installed from debian packages. Python 2.5, Ruby 1.8.5 and Ruby 1.9 were compiled from source tarballs.

said on 03 Jan 2007 at 07:59

I got it compiled (thanks TaQ, I had to re-check-out, not just make clean and reconfigure) I ran Jaroslaw’s addition benchmark for Ruby on my lowly 1.6GHz Athlon, and got a 50% speed increase between 1.8.5 and 1.9.0 :D

said on 03 Jan 2007 at 13:40

This is very disappointing.

said on 03 Jan 2007 at 15:35

I do, on the other hand, get much better run times. s=0; 1.upto( 10000 ){|i| s += i} is ten times faster than 1.8.5 on a Sempron 2200!! Is it internally made into byte code?

said on 05 Jan 2007 at 12:10

does it run camping? ;)

said on 06 Jan 2007 at 10:31

@rcorsaro: yes, as far as I understand, it’s assebled and then executed by the VM.

funny…we really have to find out what’s causing those huge benchmark differences.

said on 07 Jan 2007 at 23:54

Does Rails work on YARV ?

said on 08 Jan 2007 at 18:07

To clarify for those having FlashHater’s parser_yylex compile error, install gperf into your path and restart from the autoreconf -ivf step.

said on 10 Jan 2007 at 07:16

@Curious Cat: ko1 made it work, yes. maybe a few code adjustements due to changes in Ruby 1.9 are needed, haven’t tried yet.

said on 10 Jan 2007 at 22:17

Has anybody tried compiling on win32/win64? I end up with a whole bunch of unresolved externals on msvcr80-ruby19-static.lib, when it’s trying to compile miniruby.exe

11 Jul 2010 at 20:47

* do fancy stuff in your comment.