• 0

libxml vs. java's jaxp


Question

Howdy,

late yesterday eavening I felt bored and did some benchmarking on my MML parser.

The MML parser is a xslt sheet that parses plain text markup wich is somewhat like markdown.

The results are here. In case someone is interested.

kindest regards,

Moritz "neofeed" Angermann

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Haven't read your site in detail yet. But on the surface, I don't know if you would want to factor out the integer parse method. It won't speed it much to make a difference but some people (like me) are usually nitpickey about seeing these things in benchmarks.

for (int i = 0; i < Integer.parseInt(args[0]); i++)

//to
int t = Integer.parseInt(args[0]);
for (int i = 0; i < t; i++)

Link to comment
Share on other sites

  • 0
Haven't read your site in detail yet. But on the surface, I don't know if you would want to factor out the integer parse method. It won't speed it much to make a difference but some people (like me) are usually nitpickey about seeing these things in benchmarks.

for (int i = 0; i < Integer.parseInt(args[0]); i++)

//to
int t = Integer.parseInt(args[0]);
for (int i = 0; i < t; i++)

If I'd give java that speed increase I should have stared hacking xsltproc to have some equal speedup too.

I needed to embed the loop into java to get around the warm-up VM time. at least a little.

At the this benchmark I'd say I favour Java a bit more as I give it to have some compiling optimisations. Wich xsltproc hasn't. xsltproc as it stands now has to init, load libs, process.

It's not a perfectly conducted benchmark. But I think for 1000 runs it does give quite well a comparison of both. Especially as for the targeted use: websites.

You would run java on an application server. wich would have the vm running already. And call xsltproc via some system command or some wrapper wich does about the same.

If I would want to speed up java I'd take the argument parsing before the loop. But it's supposed to be a somewhat fair comparison. and the drawback java gets though the reparsing. Should be somewhat fair - I think.

kindest regards,

Moritz "neofeed" Angermann

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.