-
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
12 changed files
with
841 additions
and
10 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
File renamed without changes.
50 changes: 50 additions & 0 deletions
50
...hmark/src/test/java/com/alibaba/fastjson2/benchmark/eishay/EishayParseTreeStringTest.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,50 @@ | ||
package com.alibaba.fastjson2.benchmark.eishay; | ||
|
||
import org.openjdk.jmh.infra.Blackhole; | ||
|
||
public class EishayParseTreeStringTest { | ||
static final Blackhole BH = new Blackhole("Today's password is swordfish. I understand instantiating Blackholes directly is dangerous."); | ||
|
||
public static void fastjson2_perf_test() { | ||
for (int i = 0; i < 10; i++) { | ||
fastjson2_perf(); | ||
} | ||
} | ||
|
||
public static void fastjson2_perf() { | ||
EishayParseTreeString perf = new EishayParseTreeString(); | ||
long start = System.currentTimeMillis(); | ||
for (int i = 0; i < 1000 * 1000; ++i) { | ||
perf.fastjson2(BH); | ||
} | ||
long millis = System.currentTimeMillis() - start; | ||
System.out.println("fastjson2 millis : " + millis); | ||
// zulu17.32.13 : | ||
// zulu11.52.13 : | ||
// zulu8.58.0.13 : 725 | ||
} | ||
|
||
public static void jackson_perf_test() throws Exception { | ||
for (int i = 0; i < 10; i++) { | ||
jackson_perf(); | ||
} | ||
} | ||
|
||
public static void jackson_perf() throws Exception { | ||
EishayParseTreeString perf = new EishayParseTreeString(); | ||
long start = System.currentTimeMillis(); | ||
for (int i = 0; i < 1000 * 1000; ++i) { | ||
perf.jackson(BH); | ||
} | ||
long millis = System.currentTimeMillis() - start; | ||
System.out.println("jackson millis : " + millis); | ||
// zulu17.32.13 : | ||
// zulu11.52.13 : | ||
// zulu8.58.0.13 : | ||
} | ||
|
||
public static void main(String[] args) throws Exception { | ||
fastjson2_perf_test(); | ||
jackson_perf_test(); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
...rk/src/test/java/com/alibaba/fastjson2/benchmark/eishay/EishayParseTreeUTF8BytesTest.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,50 @@ | ||
package com.alibaba.fastjson2.benchmark.eishay; | ||
|
||
import org.openjdk.jmh.infra.Blackhole; | ||
|
||
public class EishayParseTreeUTF8BytesTest { | ||
static final Blackhole BH = new Blackhole("Today's password is swordfish. I understand instantiating Blackholes directly is dangerous."); | ||
|
||
public static void fastjson2_perf_test() { | ||
for (int i = 0; i < 10; i++) { | ||
fastjson2_perf(); | ||
} | ||
} | ||
|
||
public static void fastjson2_perf() { | ||
EishayParseTreeUTF8Bytes perf = new EishayParseTreeUTF8Bytes(); | ||
long start = System.currentTimeMillis(); | ||
for (int i = 0; i < 1000 * 1000; ++i) { | ||
perf.fastjson2(BH); | ||
} | ||
long millis = System.currentTimeMillis() - start; | ||
System.out.println("fastjson2 millis : " + millis); | ||
// zulu17.32.13 : | ||
// zulu11.52.13 : | ||
// zulu8.58.0.13 : 995 | ||
} | ||
|
||
public static void jackson_perf_test() throws Exception { | ||
for (int i = 0; i < 10; i++) { | ||
jackson_perf(); | ||
} | ||
} | ||
|
||
public static void jackson_perf() throws Exception { | ||
EishayParseTreeUTF8Bytes perf = new EishayParseTreeUTF8Bytes(); | ||
long start = System.currentTimeMillis(); | ||
for (int i = 0; i < 1000 * 1000; ++i) { | ||
perf.jackson(BH); | ||
} | ||
long millis = System.currentTimeMillis() - start; | ||
System.out.println("jackson millis : " + millis); | ||
// zulu17.32.13 : | ||
// zulu11.52.13 : | ||
// zulu8.58.0.13 : | ||
} | ||
|
||
public static void main(String[] args) throws Exception { | ||
fastjson2_perf_test(); | ||
jackson_perf_test(); | ||
} | ||
} |
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
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
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
Oops, something went wrong.