sonic-cpp
sonic-cpp copied to clipboard
A fast JSON serializing & deserializing library, accelerated by SIMD.
# Main Changes - Implement MergePatch and Merge API following [RFC 7386](https://www.rfc-editor.org/rfc/rfc7386) API. - Provide UpdateFrom and Update API - Remove GenericNode template parameter **Allocator**.
- Is the `struct bind` capability in roadmap a convenient way to serialize and deserialize a struct? - The plan is which bi-monthly will support this?
This patch improves sonic json decoder performance on Arm SVE2 CPU. It leverages SVMATCH instruction to locate multiple tokens in a vector efficiently. Enable this feature by specifying cmake option...
This patch implements a SVE2 version of str2int which improves number decoding on ARM SVE2 CPUs. The algorithm utilizes SVMATCH to count valid digits in the string, and SDOT for...
This PR uses the same approach than x86 for doing the OnDemand parsing on ARM. On a NVIDIA Grace cpu this results in a 5x speedup for the twitter benchmark...
sonic-cpp-1.0.1/include/sonic/internal/arch/sse/simd.h:159:37: error: ‘_mm_max_epi8’ was not declared in this scope return _mm_max_epi8(*this, other); #include 加了编译选项 -msse2 也没用 是编译器版本低了吗? 最低要求是哪个版本?
Some code is useless
# Summary This pull request introduces support for the RISC-V Vector Extension (RVV) with 128-bit vector size in the sonic-cpp library. # Key Changes **CMake Configuration**: Added a new build...
sonic-cpp解析和序列化干不赢yyjson,大概率也干不赢 [LJSON](https://github.com/lengjingzju/json) 的复用模式(模式3) * LJSON使用复用模式生成可编辑DOM,**速度可比yyjson快约100%,内存占用只有yyjson的约50%** * LJSON的文件流模式支持**真流式**解析和序列化(边读文件边解析,边序列化边写文件) * LJSON使用C99,**没有使用手动SIMD等依赖具体CPU架构的优化**,Linux-GCC/CLANG 和 Windows-MSVC编译都能支持(最初还运行在平头哥的CSKY-ECOS上) 以下是 Intel i7-1260P& OS: Ubuntu 20.04 (VMWare) 测试结果(第一个测试1000x表示放大1000倍(测试1次), 第2个测试的参数1000表示重复测试1000次),LJSON复用模式解析达到了**2.5GB/s**的解析速度。  LJSON使用自研数值和字符串转换引擎 * 浮点 ↔ 字符串转换性能远超标准库算法和小超主流算法(sprintf、grisu2、dragonbox) * float64精度设定为16位十进制数字,边界处理追求最短表示而非机械的偶数舍入
标量代码demo link : https://onlinegdb.com/OPKdOpikG 算法原理 : [fast_f2d.pdf](https://github.com/user-attachments/files/23147542/fast_f2d.pdf) 后续如果我有时间,再完成AVX-512和AVX-2实现,预计比现有所有的浮点数打印算法快几倍,加速json文件输出过程。