From: Stephen Bannasch Date: 2006-05-26T12:13:03+09:00 Subject: Re: YARV speed test: XML processing Hi Daniel, >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. I'm not using the stream api. I'm creating a dom tree and using rexml's version of xpath to process the tree. I do processing on the results and create a set of ruby objects. Unless there is something important I'm missing I assume that yarv is just executing my algorithms faster. I can't see how it would know to use the stream api. I hadn't used yarv before and wanted to see how it works and I picked a script that runs pretty slowly and spends most of its time in native Ruby so I could see how much faster it would be. I think a 2x speed up is nice. -- - Stephen Bannasch Concord Consortium, http://www.concord.org