Skip to content

Replacing nlohmann::json with a much faster alternative #14710

@wyattgill9

Description

@wyattgill9

Is your feature request related to a problem?

If you consider performance a problem then yes!, else no.

Within nixpkgs, theres ~900k lines of JSON across 740+ files, from nix develop to the store, JSON is used throughout the entire system, making JSON generation and parsing performance critical.

Proposed solution

nlohmann::json is a staple in the C++ JSON world. But Nix has grown far larger than the everyday pet projects that it was designed to support. Many newer, much more performant JSON parsers and generators have been developed in order to combat this problem, many of which are used every day in the private sector. C++ JSON benchmark: https://github.com/miloyip/nativejson-benchmark

Alternative solutions

Instead of a full scale rewrite, wrap one of these high performance JSON implementations with an API that more closely resembles that of nlohmann::json.

Additional context

Checklist


Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions