Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

sonic-cpp的SIMD加速不一定比架构设计、算法优化和微观调优的性能高,可以和LJSON性能对比

Open
#119 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
c, cpp
Domain
performance

Research direction

The issue names no sonic-cpp files, entry points, or tests. Start by reviewing the reported benchmark conditions and comparing them with LJSON's reuse and streaming modes. Done should be a reproducible, agreed comparison that clarifies whether sonic-cpp needs a specific performance change.

Written by the indexing model from the issue text.

Description

sonic-cpp解析和序列化干不赢yyjson,大概率也干不赢 LJSON 的复用模式(模式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的解析速度。

Image

Image

LJSON使用自研数值和字符串转换引擎

  • 浮点 ↔ 字符串转换性能远超标准库算法和小超主流算法(sprintf、grisu2、dragonbox)
  • float64精度设定为16位十进制数字,边界处理追求最短表示而非机械的偶数舍入
Image
Dominant language
C++
Stars
977
Forks
128
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bytedance/sonic-cpp

All issues in bytedance/sonic-cpp

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.