-
Notifications
You must be signed in to change notification settings - Fork 495
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
119 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
benchmark/src/test/java/com/alibaba/fastjson2/benchmark/Issue609Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package com.alibaba.fastjson2.benchmark; | ||
|
||
import static com.alibaba.fastjson2.benchmark.JMH.BH; | ||
|
||
public class Issue609Test { | ||
public static void fastJSON1ArrayDeTime_test() throws Exception { | ||
for (int i = 0; i < 10; i++) { | ||
fastJSON1ArrayDeTime(); | ||
} | ||
} | ||
|
||
public static void fastJSON1ArrayDeTime() throws Exception { | ||
Issue609 benchmark = new Issue609(); | ||
|
||
long start = System.currentTimeMillis(); | ||
for (int i = 0; i < 100; ++i) { | ||
benchmark.fastJSON1ArrayDeTime(BH); | ||
} | ||
long millis = System.currentTimeMillis() - start; | ||
System.out.println("fastJSON1ArrayDeTime : " + millis); | ||
// zulu8.62.0.19 : 2365 | ||
// zulu11.52.13 : | ||
// zulu17.32.13 : | ||
// zulu18.28.13 : | ||
// zulu19.0.47 : | ||
// corretto-8 : | ||
// corretto-11 : | ||
// corretto-17 : | ||
// corretto-18 : | ||
// oracle-jdk-17.0.4 : | ||
// oracle-jdk-18.0.2 : | ||
} | ||
|
||
public static void fastJSON2ArrayDeTime_test() throws Exception { | ||
for (int i = 0; i < 10; i++) { | ||
fastJSON2ArrayDeTime(); | ||
} | ||
} | ||
|
||
public static void fastJSON2ArrayDeTime() throws Exception { | ||
Issue609 benchmark = new Issue609(); | ||
|
||
long start = System.currentTimeMillis(); | ||
for (int i = 0; i < 100; ++i) { | ||
benchmark.fastJSON2ArrayDeTime(BH); | ||
} | ||
long millis = System.currentTimeMillis() - start; | ||
System.out.println("fastJSON2ArrayDeTime : " + millis); | ||
// zulu8.62.0.19 : 1473 | ||
// zulu11.52.13 : | ||
// zulu17.32.13 : | ||
// zulu18.28.13 : | ||
// zulu19.0.47 : | ||
// corretto-8 : | ||
// corretto-11 : | ||
// corretto-17 : | ||
// corretto-18 : | ||
// oracle-jdk-17.0.4 : | ||
// oracle-jdk-18.0.2 : | ||
} | ||
|
||
public static void main(String[] args) throws Exception { | ||
fastJSON1ArrayDeTime_test(); | ||
// fastJSON2ArrayDeTime_test(); | ||
} | ||
} |