Gossip less, directly on the code:
String test = "{\" name\ ": \" Peter\ "}"; Long T1 = System.currenttimemillis (); Jsonobject jsonobject = jsonobject.fromobject (test); Long t2 = System.currenttimemillis (); System.out.println ("Net.sf.json.JSONObject Conversion Time:" + (T2-T1)); long T3 = System.currenttimemillis (); Com.alibaba.fastjson.JSONObject Fastjson = com.alibaba.fastjson.JSONObject.parseObject (test); long T4 = System.currenttimemillis (); System.out.println ("Com.alibaba.fastjson.JSONObject Conversion Time:" + (T4-T3)); System.out.println ("Time difference Multiples:" + (T2-T1)/(T4-T3));
The main goal is to test the speed of the JSON conversion. Here is the result of the printout:
Net.sf.json.JSONObject conversion Time-consuming: 2884com.alibaba.fastjson.jsonobject conversion Time: 52 Times difference Multiple: 55
See the results for your choice.
JSON tool class conversion speed comparison