mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add FastCharBuffer
This commit is contained in:
@@ -12,7 +12,7 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
@BenchmarkMode(Mode.AverageTime)//每次执行平均花费时间
|
||||
@Warmup(iterations = 1, time = 1) //预热5次调用
|
||||
@Measurement(iterations = 1, time = 5, timeUnit = TimeUnit.SECONDS) // 执行5此,每次1秒
|
||||
@Measurement(iterations = 5, time = 5, timeUnit = TimeUnit.SECONDS) // 执行5此,每次1秒
|
||||
@Threads(1) //单线程
|
||||
@Fork(1) //
|
||||
@OutputTimeUnit(TimeUnit.NANOSECONDS) // 单位:纳秒
|
||||
@@ -38,6 +38,12 @@ public class JsonToStringJmh {
|
||||
Assertions.assertNotNull(jsonStr);
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public void gsonAppendJmh() {
|
||||
final String jsonStr = gson.toString();
|
||||
Assertions.assertNotNull(jsonStr);
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public void hutoolJmh() {
|
||||
final String jsonStr = hutoolJSON.toString();
|
||||
|
Reference in New Issue
Block a user