JDK-7032154 : Performance tuning of sun.misc.FloatingDecimal/FormattedFloatingDecimal
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-03-29
  • Updated: 2013-07-18
  • Resolved: 2013-06-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b96Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
Current FloatingDecimal implementation contains serious scalability issue ("static synchronized" method), that was fixed. A lot of other improvement also were done.

I have to note that I do not change existing algorithm, I only tuned existing.

Performance result:

1. double -> String
I've separated 3 paths here: using long conversion, "fast path iterative" and "slow path iterative" (slow path uses big arithmetic). Paths have different performance (for example long conversion is 20x times faster than "slow path iterative"), that is why I measured results separately for each path.

-  long conversion         - +40% boost on SPARC (+30% in x86)
- "fast path iterative"    - +10%
- "slow path iterative" (single threaded) - +80%
- "slow path iterative" (multi threaded) - up to 6.5x times faster (on SPARC with 64 hw threads) due to solving scalability problem.

2. Decimal string -> double

- "fast path" - +10%
- "slow path" (single threaded) - +60% on SPARC (+50% on x86)
- "slow path" (multi threaded) - up to 20x times faster (on SPARC with 64 hw threads) due to solving scalability problem.

3. Hex string -> double

- "fast path" (single threaded) - 3x times faster
- "fast path" (multi threaded) - up to 15x times (scalability)
- "slow path" (single threaded) - 5x times
- "slow path" (multi threaded) - up to 27x times (scalability)

4. Modification java.text.DigitList.
 (avoid reparsing string obtained from double into digits and exponent) - +15%-%30 (to performance of NumberFormat for double)