mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
performance tests: adjust CPU timings to JBR 11
GitOrigin-RevId: 433d033413da660da809b1e2c0af1f7468f85964
This commit is contained in:
committed by
intellij-monorepo-bot
parent
9ff256466a
commit
76e6d9e613
@@ -16,6 +16,7 @@
|
||||
package com.intellij.testFramework;
|
||||
|
||||
import com.intellij.concurrency.JobSchedulerImpl;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
|
||||
import java.io.*;
|
||||
@@ -38,7 +39,13 @@ public class Timings {
|
||||
public static final long REFERENCE_IO_TIMING = 100;
|
||||
|
||||
static {
|
||||
CPU_TIMING = CpuTimings.calcStableCpuTiming();
|
||||
long cpuTiming = CpuTimings.calcStableCpuTiming();
|
||||
if (SystemInfo.isJavaVersionAtLeast(11, 0, 0)) {
|
||||
// on JBR 11, the code for CPU timings executes much faster, while most tests take roughly the same time
|
||||
// so we correct for the difference until we have a more robust timing calculation
|
||||
cpuTiming = cpuTiming * 54 / 31;
|
||||
}
|
||||
CPU_TIMING = cpuTiming;
|
||||
|
||||
long start = System.nanoTime();
|
||||
for (int i = 0; i < IO_PROBES; i++) {
|
||||
|
||||
Reference in New Issue
Block a user