Image of Ruby News
r20090711
nokogiri vs. hpricot
>ruby r20090711_1.rb
XML Document parsing benchmark
user system total real
hpricot:xml:doc 8.656000 0.063000 8.719000 ( 10.875000)
hpricot2:xml:doc 11.329000 0.156000 11.485000 ( 13.922000)
nokogiri:compat:doc 4.406000 0.187000 4.593000 ( 5.828000)
nokogiri:xml:doc 4.500000 0.063000 4.563000 ( 5.656000)
XML XPath benchmarks (//status/text, //user/name)
user system total real
hpricot:xml:xpath 25.890000 0.125000 26.015000 ( 30.938000)
hpricot2:xml:xpath 25.891000 0.094000 25.985000 ( 32.000000)
nokogiri:compat:xpath 1.016000 0.078000 1.094000 ( 1.484000)
nokogiri:xml:xpath 0.578000 0.000000 0.578000 ( 0.828000)
XML CSS selector benchmarks (status text, user name)
user system total real
hpricot:xml:css 19.344000 0.297000 19.641000 ( 23.985000)
hpricot2:xml:css 19.859000 0.156000 20.015000 ( 25.328000)
nokogiri:compat:css 1.203000 0.047000 1.250000 ( 1.656000)
nokogiri:xml:css 0.891000 0.000000 0.891000 ( 1.297000)
HTML Document parsing benchmark (slashdot.org)
user system total real
hpricot:html:doc 33.781000 0.250000 34.031000 ( 42.047000)
hpricot2:html:doc 32.641000 0.265000 32.906000 ( 42.953000)
nokogiri:html:doc 35.968000 0.313000 36.281000 ( 44.234000)
HTML XPath benchmarks (//h1/a)
user system total real
hpricot:html:xpath 7.782000 0.094000 7.876000 ( 9.781000)
nokogiri:html:xpath 0.437000 0.000000 0.437000 ( 0.563000)
Easy HTML CSS benchmarks (h1 > a)
user system total real
hpricot:html:css 7.656000 0.110000 7.766000 ( 9.562000)
nokogiri:html:css 0.469000 0.015000 0.484000 ( 0.547000)
Hard HTML CSS benchmarks (div#logo > h1 > a)
user system total real
hpricot:html:css 18.906000 0.219000 19.125000 ( 24.156000)
nokogiri:html:css 2.422000 0.016000 2.438000 ( 2.953000)
>Exit code: 0