I have been doing some performance testing, and have noticed it takes
significantly longer to render a XML output then a HTML one. It made me
think perhaps there's a faster way of generating XML than using XML
builder.
I did a quick search and did not find any alternatives, or anyone
talking about XML builder's performance issues.
Is there anyway of optimizing XML Builder? Or is there a faster
alternative?
However the builder API is nice and for me personally worth the slightly longer output. However saying that I managed to output 100 records to XML within 10 seconds and I don't think it's builder slowing things down.
I have been doing some performance testing, and have noticed it takes
significantly longer to render a XML output then a HTML one. It made me
think perhaps there's a faster way of generating XML than using XML
builder.
I did a quick search and did not find any alternatives, or anyone
talking about XML builder's performance issues.
Is there anyway of optimizing XML Builder? Or is there a faster
alternative?
--
Posted via http://www.ruby-forum.com/.
The standard answer for XML performance issues in Ruby is to switch to
libxml-ruby.
···
On Fri, Oct 31, 2008 at 9:01 AM, Xin Zheng <crazygecko@gmail.com> wrote:
I have been doing some performance testing, and have noticed it takes
significantly longer to render a XML output then a HTML one. It made me
think perhaps there's a faster way of generating XML than using XML
builder.
I have been doing some performance testing, and have noticed it takes
significantly longer to render a XML output then a HTML one. It made me
think perhaps there's a faster way of generating XML than using XML
builder.
I did a quick search and did not find any alternatives, or anyone
talking about XML builder's performance issues.
Is there anyway of optimizing XML Builder? Or is there a faster
alternative?
--
we can deny everything, except that we have the possibility of being better. simply reflect on that.
h.h. the 14th dalai lama
I remember looking at this a while back and it turns out that a significant bottleneck is how builder escapes your text (look in the builder source for to_xs). It's doing a lot more that it has too (although I don't deny that a lot of the time that will be useful). There's a gem (fast_xs) which implements that in C and makes that bottleneck a lot faster.
Fred
···
On 31 Oct 2008, at 13:01, Xin Zheng wrote:
Hi all,
I have been doing some performance testing, and have noticed it takes
significantly longer to render a XML output then a HTML one. It made me
think perhaps there's a faster way of generating XML than using XML
builder.
I did a quick search and did not find any alternatives, or anyone
talking about XML builder's performance issues.
Is there anyway of optimizing XML Builder? Or is there a faster
alternative?
Unfortunately its speed diminshes a lot as the number of nodes increase.
If the documents are large, you should try Nokogiri's builder. I found
it to be faster for larger documents than faster-builder.
On Fri, Oct 31, 2008 at 10:01:14PM +0900, Xin Zheng wrote:
Hi all,
I have been doing some performance testing, and have noticed it takes
significantly longer to render a XML output then a HTML one. It made me
think perhaps there's a faster way of generating XML than using XML
builder.
I did a quick search and did not find any alternatives, or anyone
talking about XML builder's performance issues.
Is there anyway of optimizing XML Builder? Or is there a faster
alternative?
However the builder API is nice and for me personally worth the slightly
longer output. However saying that I managed to output 100 records to
XML within 10 seconds and I don't think it's builder slowing things
down.
Thanks for the reply.
I'm using it to output KML on the fly, so every half a second counts. At
the moment, it's taking .5 seconds longer to generate a small-ish file
than it takes for the HTML output.
If there are no clear drop-in alternatives, I might leave off optimising
my KML outputs.