HipJSON: A high performance implementation of JSON parser with std.json syntax. Used by Redub and Hipreme Engine
9il
ilyayaroshenko at gmail.com
Thu Nov 6 16:39:22 UTC 2025
On Thursday, 23 October 2025 at 01:50:55 UTC, Hipreme wrote:
> Hey folks! I've decided to release HipJSON because this
> dependency is being used frequently in both Hipreme Engine and
> Redub, and the main difference is that it uses highly optimized
> data structures inside it:
>
> - StringBuffer so all the string allocations are linear
> - [D Segmented
> Hashmap](https://code.dlang.org/packages/d-segmented-hashmap):
> A hashmap which does not require rehashing, thus making it the
> fastest solution possible for a JSON parser
> - JSONArray which makes smart use of stack memory and promotion
> to dynamic memory on demand
>
>
> It is the only JSON parser in D I saw being faster than the one
> present in JavaScript which I think it is a good benchmark as
> JSON is super important for web. Here are some stats comparison
> for some common JSON libraries:
>
> ```
> STD JSON: 336 ms, 836 μs, and 6 hnsecs (50000 Tests)
> JSONPIPE: 206 ms and 571 μs (50000 Tests)
> MIR JSON: 266 ms, 770 μs, and 7 hnsecs (50000 Tests)
> HipJSON: 86 ms, 881 μs, and 8 hnsecs (50000 Tests)
> ```
Hi,
I have added proper Mir tests.
Otherwise, the benchmark is misleading: Mir ASDF is a few times
faster.
https://github.com/MrcSnm/hipjson/pull/1
#### Target = Apple M4
```
STD JSON: 340 ms, 500 μs, and 7 hnsecs (50000 Tests)
JSONPIPE: 239 ms and 89 μs (50000 Tests)
Mir Ion Algebraic: 234 ms, 974 μs, and 3 hnsecs (50000 Tests)
Mir Ion Amazon : 98 ms, 492 μs, and 8 hnsecs (50000 Tests)
Mir ASDF : 22 ms, 389 μs, and 9 hnsecs (50000 Tests)
HipJSON: 85 ms, 877 μs, and 9 hnsecs (50000 Tests)
```
For a sophisticated JSON benchmark you may want to add it to
https://github.com/kostya/benchmarks
More information about the Digitalmars-d-announce
mailing list