mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -38,12 +38,6 @@ 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();
|
||||
|
@@ -1,6 +1,9 @@
|
||||
package org.dromara.hutool.json.jmh;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonParser;
|
||||
import org.dromara.hutool.json.JSONObject;
|
||||
@@ -49,4 +52,11 @@ public class ParseTreeJmh {
|
||||
final com.alibaba.fastjson2.JSONObject jsonObject = JSON.parseObject(jsonStr);
|
||||
assertNotNull(jsonObject);
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public void jacksonJmh() throws JsonProcessingException {
|
||||
final ObjectMapper mapper = new ObjectMapper();
|
||||
final JsonNode jsonNode = mapper.readTree(jsonStr);
|
||||
assertNotNull(jsonNode);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user