Not sure how much interest there is in this, but after being frustrated with
the performance of Builder I whipped up a mostly Builder-compatible frontend
to libxml-ruby. My initial benchmarks show it to be about twice as fast as
builder on large documents:
http://pastie.caboo.se/79575
libxml-ruby based proof-of-concept:
puts Benchmark.measure { xml = XmlBase.new; xml.foo(:a => :b) { 100.times{
xml.bar(:c => :d) { 1000.times { xml.baz("Text goes here") } } } }.to_s }
3.130000 1.290000 4.420000 ( 4.433537)
2.850000 1.280000 4.130000 ( 4.133377)
2.810000 1.250000 4.060000 ( 4.070264)
Builder:
puts Benchmark.measure { xml = Builder::XmlMarkup.new ; xml.foo(:a => :b)
{ 100.times { xml.bar(:c => :d) { 1000.times { xml.baz("Text goes here") } }
} } }
9.300000 0.030000 9.330000 ( 9.374801)
9.290000 0.020000 9.310000 ( 9.315121)
9.280000 0.020000 9.300000 ( 9.316049)
Tony Arcieri
_______________________________________________
libxml-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/libxml-devel