Skip to content

Benchmark comparison with velox-io/json #929

Description

@kafka1991

velox-io/json (vjson) is a recently released high-performance Go JSON library that claims impressive benchmark results (~7x faster unmarshal, ~4x faster marshal compared to encoding/json). They already include sonic in their benchmark suite. It would be interesting to add vjson to sonic's benchmark comparisons.

Basic idea of velox-io/json

vjson takes a different approach from sonic — it does not use SIMD or JIT. Instead:

  • Decoder (Unmarshal): Pure-Go implementation using a single-pass decoder with zero-copy strings, avoiding extra allocations by not copying string data when possible.
  • Encoder (Marshal): Uses a native C "JSON VM" backend (native/encvm) — a small virtual machine written in C that handles the hot encoding path. Pre-built native artifacts are shipped as .syso files, so CGo is not required at build time. A pure-Go fallback exists for unsupported platforms.

This is an interesting contrast to sonic's JIT + SIMD approach and could provide useful data points for the community.

Suggested action

Add velox-io/json to the existing benchmark suite (alongside JsonIter, GoJson, StdLib, etc.) so users can see how the two libraries compare under the same test conditions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions