FASTJSON 2.0.54 版本发布,性能进一步提
这又是一个性能优化Bug修复的版本更新版本,大家按需升级。 1. 性能优化 这个版本的性能优化包括: 1.1 使用SWAR(SIMD Within A Register)技巧来优化序列化字符串的性能 序列化时,写字符串检测是否存在特别字符是一个性能关键点,这个版本使用SWAR(SIMD Within A Register)的技巧来做快速检测。如下 package com.alibaba.fastjson2; class JSONWriterUTF8 { protected final long byteVectorQuote; JSONWriterUTF8(Context ctx) { // " -> 0x22, ' -> 0x27 this.byteVectorQuote = this.useSingleQuote ? 0x2727_2727_2727_2727L : 0x2222_2222_2222_2222L; } public void writeStringLatin1(byte[] value) { final long vecQuo...