Optimize Formatter.parse (including String.printf)

Martin Buchholz martinrb at google.com
Wed Nov 4 19:41:31 UTC 2009

Hi Sherman,

I'd like you to do a code review.


Synopsis: Optimize Formatter.parse (including String.printf)
Formatter is not as efficient as it could be.
Here's a low-hanging fruit optimization
that creates fewer objects,
and uses the idiom

return al.toArray(new FormatString[al.size()]);

I'm sure additional optimizations are possible.

Results: about 10-20% faster on in-house microbenchmarks of

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/core-libs-dev/attachments/20091104/3d84ad03/attachment.html>

More information about the core-libs-dev mailing list