ThreadLocalFormatHelper class

This is the best-performing format helper when memory is plentiful.

Syntax

private class ThreadLocalFormatHelper

Remarks

It uses theadlocal variables to create helper objects for each thread eliminating any need for synchronization. Using simple microbenchmarks, this approach was found to be ~25% faster than the synchronized format helper on a single-cpu machine. On a 4-cpu machine, this implementation was 90% faster than the synchronized format helper. Warning: this implementation exposed significant problems in very old XML implementations that resulted in OutOfMemoryError's. This was not a problem with the implementations in JDK 1.4.2 or higher. This is why we have left in the synchronized implementation.