HipJSON v1.0.3 now supports SIMD and AVX2 by default

Hipreme msnmancini at hotmail.com
Tue Nov 4 18:14:52 UTC 2025


On Sunday, 2 November 2025 at 10:06:28 UTC, Zz wrote:
>> function based on a struct, so, if one day I decide to add 
>> that API, it will be a 0 effort migration.
>
> Thanks for hipjson.
>
> Zz

I've just added SIMD support to hipjson since I thought it could 
go even faster. For the the target JSON generated with, I got up 
to 1.8GBps of parsing speed (and recall that the string memory 
are still being copied. With some tests, borrowing memory could 
go up to 3GBps) :
```d
import std.stdio;
void main()
{
     import std.file;
     string data="{";
     string str = 
"https://www.example.org/https://www.example.org/https://www.example.org/https://www.example.org/https://www.example.org/https://www.example.org/https://www.example.org/https://www.example.org/https://www.example.org/https://www.example.org/https://www.exampl";
     foreach(i; 0..1000_000)
     {
         import std.conv:to;
         if(i != 0)
             data~=",\n";
         data~= "\"hello"~i.to!string~"\": \""~str~"\"";
     }
     data~= "}";

     std.file.write("hello.json", data);
}
```
The results:

```
Parsed: 2768 MB
Took: 1460ms
MB per Second: 1896.5
Allocated: 3716.91 MB
Free: 145.827 MB
Used: 1308.89 MB
Collection Count: 5
Collection Time: 61 ms, 846 μs, and 7 hnsecs
1 modules passed unittests
```


More information about the Digitalmars-d-announce mailing list