
I have never used the Rails builder interface for JSON or XML generation. It’s nice because it’s DSL-ish, but it needs to be executed. If your data can be templated, using ERB will be better. If it is more complex with attributes, look into restructuring it so that you can use Nokogiri. I’m not sure if Ox generates as well as parses, but it may also be an option. -a
On May 18, 2023, at 04:25, Peter Hickman via ruby-talk <ruby-talk@ml.ruby-lang.org> wrote:
I'm profiling some code to try and squeeze out performance. It takes a user query, reads data from the database and returned the result as XML
I have tuned the code and database (checking the indexes, caching repeated calls etc) and what I am left with is that 95% of the call's runtime is building the XML. We are using builder because it is the standard / default for Ruby
Using Ruby 3.0.2p107 as it is the default for Ubuntu 22.04
Is there another, faster library for XML generation or will I be building this by hand?
Any suggestions
______________________________________________ ruby-talk mailing list -- ruby-talk@ml.ruby-lang.org To unsubscribe send an email to ruby-talk-leave@ml.ruby-lang.org ruby-talk info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-talk.ml.ruby-lang.org...