# Processing XML (Time Concerns)

**URL:** <https://www.ruby-forum.com/t/processing-xml-time-concerns/71644>\
**Category:** Ruby\
**Created:** [October 10, 2006, 3:40pm UTC](https://www.ruby-forum.com/t/processing-xml-time-concerns/71644 "2006-10-10T15:40:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [October 10, 2006, 3:40pm UTC](https://www.ruby-forum.com/t/processing-xml-time-concerns/71644/1 "2006-10-10T15:40:57Z")

</div>

This is purely an experiential question in nature, so I apologize for  
its clear lack of focus.

What I’m curious about is if any of you have been using REXML (or  
perhaps another XML solution for Ruby) to parse and modify XML files in  
memory. If so, what sorts of processing times have you found?

I ask this in the context that I have some pretty sparse processing  
being done on an XML file that is about 1.5 MB in size. This is, by  
necessity, tree-based parsing because I need to modify some attributes  
and elements as the parsing occurs. This kind of processing takes well  
over an hour.

I know the details of how long something takes can vary vastly by the  
details of the processing is being done but I’m just curious if people  
have done in-memory processing of XML (where the XML file is at least 1  
MB in size or greater) and how long that has taken.

- Jeff

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [October 10, 2006, 4:39pm UTC](https://www.ruby-forum.com/t/processing-xml-time-concerns/71644/2 "2006-10-10T16:39:21Z")

</div>

On 10/10/06, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> What I’m curious about is if any of you have been using REXML (or  
> perhaps another XML solution for Ruby) to parse and modify XML files in  
> memory. If so, what sorts of processing times have you found?

Ask Tim B.:  
[http://www.tbray.org/ongoing/](http://www.tbray.org/ongoing/)  
He is doing some pretty serious work in this regard.

I have seen some benchmarks that put REXML processing at being  
about 10 times slower than an equivalent java mechanism:

[http://www.pankaj-k.net/archives/2005/11/ruby\_or\_java\_a.html](http://www.pankaj-k.net/archives/2005/11/ruby_or_java_a.html)

REXML is the ‘user-friendly’ and cross platform ruby parser.  
When you need hardcore performance, you need to check out  
one of the alternative Ruby parsers (typically implemented in  
C). YMMV.

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [July 23, 2007, 1:23pm UTC](https://www.ruby-forum.com/t/processing-xml-time-concerns/71644/3 "2007-07-23T13:23:58Z")

</div>

> REXML is the ‘user-friendly’ and cross platform ruby parser.  
> When you need hardcore performance, you need to check out  
> one of the alternative Ruby parsers (typically implemented in  
> C). YMMV.

For sure, checkout libxml - it is a great deal faster than REXML. Tim.
