ruby on rails - Is there a drop-in replacement for ActiveRecord to_xml that's faster? -
I have a large array of ActiveRecord objects (~ 400 elements) that I have to convert to XML. I've used array.to_xml
for convenience, but it is very slow - the server is busy for 20 seconds, and about 5 seconds when idle.
I was just a server passive, and found that:
- The ActiveRecord query (with two-level completions included) is approximately 0.3 on average.
- To convert, the approximate results on XML takes approximately 4.9 s. 4.86 s user CPU time out of that.
Is the builder :: XML drop-in replacement for markup that will improve the speed of the two-XML? Or do I have to roll in some hands?
The following link claims to be a 2 - 3x speed increase. It is not a drop in substitution, but it is a technique that uses to create the structure that the two-XML will move faster.
Comments
Post a Comment