JDK-8076287 : Performance degradation observed with TimeZone Benchmark
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 8,8u40
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-03-31
  • Updated: 2015-10-09
  • Resolved: 2015-04-16
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 JDK 9
8u60Fixed 9 b61Fixed
Related Reports
Relates :  
Relates :  
Description
Running the following benchmark with 8u40 is about 2-3x slower than running it with 7u76 64 bit:

package misc.bench;

import java.util.Date;
import java.util.TimeZone;

public class TimeZoneBench {

    private static final int ITERS = 100000;

    private static void bench() {
        Date d = new Date();
        for (int i=0; i < ITERS; i++) {
            d.toString();
        }
    }
    
    public static void main(String[] args) {
        TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
        System.out.println(TimeZone.getDefault());
        bench(); // warmup
        long start = System.nanoTime();
        bench();
        System.out.println("Time per call : " + (System.nanoTime() - start) / ITERS + " ns");
    }
}