Fast XML output

Hi,

we just started playing with ruby and ActiveRecord a few days ago at
my company and we're having major troubles of outputting xml fast
enough.

Pure xml output from ActiveRecord::Base takes approx 20s for 500
objects (that are small and simple). Does anyone have any pointers?
How fast is REXML?

Slow as hell. We just did a refactoring today, going from xml to json to pass AR data between apps. We achieved an order of magnitude speed increase and profiling showed 70% of the time on the client side was spent parsing xml and 30% on the server side creating the xml reppresentation.

If you're stuck with XML I'd look into a replacement for rexml.

···

On Wed, 23 Apr 2008 04:40:07 +0900, Michael Litton wrote:

Hi,

we just started playing with ruby and ActiveRecord a few days ago at
my company and we're having major troubles of outputting xml fast
enough.

Pure xml output from ActiveRecord::Base takes approx 20s for 500
objects (that are small and simple). Does anyone have any pointers?
How fast is REXML?

Look into libxml.

···

On Tue, Apr 22, 2008 at 3:40 PM, Michael Litton <michael.e.litton@gmail.com> wrote:

Pure xml output from ActiveRecord::Base takes approx 20s for 500
objects (that are small and simple). Does anyone have any pointers?
How fast is REXML?

--
Avdi

Home: http://avdi.org
Developer Blog: Avdi Grimm, Code Cleric
Twitter: http://twitter.com/avdi
Journal: http://avdi.livejournal.com

The devil is in the details. I rewrote my XML-manipulation class to use
libxml instead of REXML and the libxml-based version of my routine takes
twice as long as the REXML-based version. So it all depends on exactly
what you do with it... m.

···

Avdi Grimm <avdi@avdi.org> wrote:

On Tue, Apr 22, 2008 at 3:40 PM, Michael Litton > <michael.e.litton@gmail.com> wrote:
> Pure xml output from ActiveRecord::Base takes approx 20s for 500
> objects (that are small and simple). Does anyone have any pointers?
> How fast is REXML?

Look into libxml.

--
matt neuburg, phd = matt@tidbits.com, Matt Neuburg’s Home Page
Leopard - http://www.takecontrolbooks.com/leopard-customizing.html
AppleScript - http://www.amazon.com/gp/product/0596102119
Read TidBITS! It's free and smart. http://www.tidbits.com