HipJSON: A high performance implementation of JSON parser with std.json syntax. Used by Redub and Hipreme Engine

Hipreme msnmancini at hotmail.com
Thu Oct 23 01:50:55 UTC 2025


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)
```
You can test it yourself as the documentation shows.

Against JavaScript:

```
JS performance of the parseJSON:
Parsed: 50 MB in 0.7036 s
Speed: 71.06 MB/s

HipJSON  with dub test -b release-debug --compiler=ldc2
Parsed: 50MB in 606ms
MB per Second: 86.5162
Allocated: 739.969 MB
Free: 68.7608 MB
Used: 739.962 MB
Collection Count: 7
Collection Time: 273 ms, 757 μs, and 5 hnsecs
```

I may do a `@nogc` configuration in the future, but the refactor 
to do it is kinda big and I plan to use 
[nulib](https://code.dlang.org/packages/nulib) as a backend.

Hope you guys enjoy it :)

https://code.dlang.org/packages/hipjson


More information about the Digitalmars-d-announce mailing list