From: Frederick Cheung Date: 2008-11-01T01:38:41+09:00 Subject: Re: XML builder performance 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? 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