There are a couple of things for improving SimpleDateFormat performance.
The 4326988 fix requires to scan the given pattern string to verify it. It's possible to compile a pattern string with a little extra of cpu cycles so that further scans (e.g., counting 'y's) of the same pattern in format() and parse().
SimpleDateFormat.format() invokes DecimalFormat to format numbers, such as a year number, in a locale-dependent way. However, numbers to be formatted are usually in 1, 2 or 4 digits. Some optimization can be done.
The 4326988 fix requires to scan the given pattern string to verify it. It's possible to compile a pattern string with a little extra of cpu cycles so that further scans (e.g., counting 'y's) of the same pattern in format() and parse().
SimpleDateFormat.format() invokes DecimalFormat to format numbers, such as a year number, in a locale-dependent way. However, numbers to be formatted are usually in 1, 2 or 4 digits. Some optimization can be done.
- relates to
-
JDK-4493297 performance regression in SimpleDateFormat.<init>
-
- Closed
-