alpaca-core / acord

Alpaca Core local daemon
MIT License
0 stars 0 forks source link

Use another library when parsing JSON which does not need to result in an `api::Dict` #2

Open iboB opened 2 months ago

iboB commented 2 months ago

Currently we also parse JSON in some asset sources. In the future, when we start working on the server there will likely be more places.

We use api::Dict (aka nlohmann::json as of writing this issue). While this is convenient as it supports JSON parsing, it's easy to use, and it's already there, its performance is not really good.

Even a simple library like sajson outperforms it by orders of magnitude. If we also need to generate JSON almost anything is better in perf than nlohmann.

It would be good for the environment if we consider other libs where Dict is not a requirement.

pminev commented 2 months ago

SIMDJson seems to have good performance. I'll try it to see how usable it is.

IvanFilipov commented 2 months ago

My partner (GitHub Copilot) strongly suggested RapidJSON. GitHub-RapidJSON.

iboB commented 2 months ago

Low prio. Not for mvp