Skip to content

Comment on Ruby Under a Microscope: Learning Ruby Internals through Experimentparent

Comments

It was just for fun. Both SAX APIs are sorta nebulous as it is to someone like me who's been so used to an abundance of tutorials on the tools I regularly use. Ox's SAX API was better, though.

I had just wanted to speed up my XML parser and stumbled upon a Nokogiri vs Ox benchmark (http://www.ohler.com/dev/xml_with_ruby/xml_with_ruby.html). So I tried Ox.

Here's my effort to benchmark Nokogiri vs Ox, DOM vs SAX parsing on an 80mb XML file with 38k nodes: https://gist.github.com/3977120

    Ox DOM: 6 seconds (550mb)
    Ox SAX: 6 seconds (12mb)
    Nokogiri DOM: 13 seconds (900mb)
    Nokogiri SAX: 24 seconds (11.8mb)
I'm no benchmarking wizard, though.

Thank you!

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.