Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Reuse instances of DataTypeFactory #243
DatatypeFactory.newInstance is a costly call, and shows up pretty high in the profiler when performing many quick SOAP requests. I've arranged for the factory to be reused accross multiple calls.
According to the doc it's not guaranteed to be thread safe (although the implementation I'm using certainly is), so I used a ThreadLocal to get one instance per thread.