From: Daniel Sheppard Date: 2006-05-26T08:59:38+09:00 Subject: Re: YARV speed test: XML processing > I have a small (200 lines) program that processes XML files and > creates ruby object trees. It uses the native Ruby xml library REXML > a great deal. > > On my MacOS X 2GHz macintel system using the latest YARV speed up my > code by a factor of 2. > > ruby 1.8.4 (2005-12-24) [i686-darwin8.6.1] > 53 seconds > > ruby 2.0.0 (Base: Ruby 1.9.0 2006-04-08) [i686-darwin8.6.1] > YARVCore 0.4.0 Rev: 502 (2006-05-18) [opts: ] > 28 seconds I've never looked at yarv's internals, but I'm guessing that it creates ruby objects directly as it processes the stream. Unless you're using the stream api in rexml, you're comparing apples and oranges. It stands to reason that parsing a stream directly is much faster than parsing a stream to a document tree and processing the tree. I'd be surprised if it still wasn't faster to use Yarv to build a ruby object tree rather than building from an xml stream, but the difference probably wont be as great.