Home > Software Development > Using CGLIB to speed up XML parsing

Using CGLIB to speed up XML parsing

October 21st, 2003

Good stuff from Chris Nokleberg… using CGLIB to make SAX parsing zippy:

For validated documents this is safe and gives a 3X speedup.

I don’t think I’d be likely to use the if/else if/else if structure that he mentions, because that seems like the kind of thing that is screaming out for separate objects. I believe Fowler even has a refactoring for this, but it’s too early in the morning to recall which one.

Software Development

  1. October 21st, 2003 at 11:17 | #1

    You’re kind of constrained by the nature of SAX. I think the common refactoring here is to map from element names to finer-grained methods by putting Method objects into a Map and invoking via reflection. Which, of course, is even slower.

  1. No trackbacks yet.