Groovy XML Slurping Speed

We are starting a study on a project requiring sophisticated XML parsing.

I like the look of Groovy XmlSlurper (Groovy seems to be my Golden Hammer of choice at the moment). We need to handle a fairly wide range of XML inputs, and the dynamic nature of Groovy may allow us to develop a clear and concise solution. We will see.

The cost of this flexibility and dynamism in terms of speed is worrying, although I have not tested it yet. Does anyone have any experience? Are Groovy and XmlSlurper particularly fast or slow compared to some Java parsing alternatives?

+4
source share
2 answers

I have not seen any serious performance issues with XmlSlurper, but you should use it carefully:

+2
source

In my experience, the speed at which you can get something up and running in Groovy far exceeds any slowdown caused by its dynamic nature ...

And in rare cases, this greatly affects your application, you can always abandon the Groovy code and write a Java class that adheres to the same interface and must connect directly to it ...

Hmmm ... this is not really the answer. I think you could see it more as words of encouragement from the sensory line; -)

+1
source

All Articles