#2216 Repeated Instantiation of SAXParserFactory

Performance
closed-fixed
5
2011-06-15
2011-06-03
No

There are a few variations, but the key here is that CloseableIteratorSAX is getting a new instance of SAXParserFactory. The SAXParserFactory.newInstance method has to go off on a search through classloaders (probably to find a file indicating what parser implementation should be used). This results in filesystem activity, so there is some performance overhead. And we appear to be going down this path quite a bit.

I would expect that CloseableIteratorSAX could keep a single static instance of the SAXParserFactory, and then the constructor would just have to create a new SAXParser instance.

I'm adding the file that I changed that can be used as a refrence.

Discussion

  • Dave Blaschke

    Dave Blaschke - 2011-06-04
    • assigned_to: nobody --> blaschke-oss
    • status: open --> open-accepted
     
  • Dave Blaschke

    Dave Blaschke - 2011-06-04
    • status: open-accepted --> open-fixed
     
  • Dave Blaschke

    Dave Blaschke - 2011-06-04

    Patch sent for community review. During a 2 week period any
    exploiter may comment on the patch, request changes or turn it
    down completely (with good reason). For the time being the patch is part of the "Experimental" branch in CVS.

     
  • Dave Blaschke

    Dave Blaschke - 2011-06-04

    This change produces a 2% performance improvement

     
  • Dave Blaschke

    Dave Blaschke - 2011-06-14

    Patch against HEAD

     
  • Dave Blaschke

    Dave Blaschke - 2011-06-14
    • status: open-fixed --> pending-fixed
     
  • Dave Blaschke

    Dave Blaschke - 2011-06-14

    The community review has completed and we received no substantial criticism. Therefore the patch has been approved and merged into the "HEAD" branch. The next release will pick it up.

     
  • Dave Blaschke

    Dave Blaschke - 2011-06-14

    NOTE: Community review shortened to 10 days due to tomorrow's release of 2.1.9

     
  • Dave Blaschke

    Dave Blaschke - 2011-06-15

    The patch was picked up by release 2.1.9 and will therefore be closed.

     
  • Dave Blaschke

    Dave Blaschke - 2011-06-15
    • status: pending-fixed --> closed-fixed
     

Log in to post a comment.