近期使用 json 时,发现 nutz 不同版本间性能差异非常大!
long start = System.currentTimeMillis();
String str = "[{'enkey':'glass dome for vape pen'}, {'enkey':'dry vaporizer vape pen'}, {'enkey':'metal vape pen'}, {'enkey':'vape pen cartridge kit black'}, {'enkey':'cheap vape pen ego'}, {'enkey':'free shipping vape pen coil'}, {'enkey':'titan vape pen'}, {'enkey':'vape pen rechargeable'}, {'enkey':'usb charged vape pen'}, {'enkey':'wholesale click n vape pen'}, {'enkey':'vision ego vape pen'}, {'enkey':'wax vape pen replacement atomizer'}, {'enkey':'click n vape pen butane'}, {'enkey':'bud dex vape pen'}, {'enkey':'vape pen battery designs'}, {'enkey':'wax vape pen atomizers'}, {'enkey':'thc oil vape pen'}, {'enkey':'vape pen skillet attachment'}, {'enkey':'bbtank disposable vape pen'}, {'enkey':'vape pen pink'}, {'enkey':'snoop dogg red vape pen'}, {'enkey':'ceramic vape pen'}, {'enkey':'e slim vape pen kit'}, {'enkey':'vape pen battery china'}, {'enkey':'ml vape pen'}, {'enkey':'o pen vape pen sales'}, {'enkey':'smok vape pen'}, {'enkey':'vape pen usb passthrough'}, {'enkey':'free cartridge vape pen'}, {'enkey':'water glass vape pen'}, {'enkey':'chamber vape pen'}, {'enkey':'vape pen mods wholesale'}, {'enkey':'vape pen glass globe wholesale'}, {'enkey':'vape pen oil tank'}, {'enkey':'oil vape pen batteries'}, {'enkey':'vape pen disposable cartridge'}, {'enkey':'vape pen black'}, {'enkey':'universal vape pen'}, {'enkey':'ego vape pen starter kit wholesale'}, {'enkey':'vape pen cartridges wick'}, {'enkey':'sale oil vape pen'}, {'enkey':'hash oil vape pen'}, {'enkey':'vape pen wax herb'}, {'enkey':'snoop dogg vape pen kit'}, {'enkey':'g dry herb vape pen black'},]";
for (int i = 0; i < count; i++) {
List<NutMap> list = Json.fromJsonAsList(NutMap.class, str);
}
long end = System.currentTimeMillis();
System.out.println("nutz json:" + (end - start));
这段代码的表现如下:
| 版本号 | 执行时间(毫秒) |
| ----------- | -------- |
| nutz-1.b.50 | 546 |
| nutz-1.b.52 | 655 |
| nutz-1.r.58 | 749 |
| nutz-1.r.60 | 812 |
| nutz-1.r.61 | 1263 |
| nutz-1.r.62 | 1373 |
| nutz-1.r.63 | 843 |
从上表可以看出,执行时间是呈现不断上涨的趋势, r.61 版本非常夸张,时间超过 b.50 版近3倍! 直到最新版本才稍微好些,也仅仅回到了 r.60 版本的水平,仍较 b.50 版高 50% 左右。