How to parse JSON in D?

Steven Schveighoffer schveiguy at gmail.com
Tue Mar 30 13:31:11 UTC 2021


On 3/30/21 3:05 AM, Imperatorn wrote:
> On Monday, 29 March 2021 at 18:19:35 UTC, Steven Schveighoffer wrote:
>> On 3/29/21 1:48 PM, Imperatorn wrote:
>>> On Monday, 29 March 2021 at 17:21:25 UTC, tastyminerals wrote:
>>>> [...]
>>>
>>> https://youtu.be/un-bZdyumog?t=27m25s
>>
>> FYI that package is here: https://code.dlang.org/packages/jsoniopipe
>>
>> I really want to start using it, but priorities.
>>
>> It should be pretty functional, but it's a bit hard to use at the 
>> moment (unless you just want serialization). I need to work on the 
>> parsing API. The benefit is it allows parsing the JSON without 
>> constructing some tree-like representation of the data. The serializer 
>> uses this directly, which makes it fast. Probably not as fast as asdf, 
>> but I could maybe get it there with some tricks.
>>
> 
> Omg asdf gets ~300 MB/s, I thought iopipe's 200 MB/s was fast 😅

It's important to compare apples to apples (or in this case, my macbook 
to my macbook, and doing similar functions) when showing raw numbers, 
but I haven't thought about performance for jsoniopipe since that talk 
really ;)

I assume it would not be much more difficult to match or possibly exceed 
asdf's speed, it seems we have similar design goals. I'll have to at 
some point build asdf and run some benchmarks to see what my targets 
should be. At the time I used rapidjson, I got jsoniopipe to be 
comparable with not much effort.

-Steve


More information about the Digitalmars-d-learn mailing list