std.json dynamic initialization of JSONValue

Piotr Szturmaj bncrbme at jadamspam.pl
Sun Apr 1 16:11:09 PDT 2012


Nicolas Silva wrote:
> On Sat, Mar 31, 2012 at 12:25 PM, Piotr Szturmaj<bncrbme at jadamspam.pl>  wrote:
>> I have written streaming json parser using ranges. It returns slices when
>> possible. Benchmarked it and it's about 2.05x the speed of std.json.
>>
>> It gives possibility to "dig" into the structure and stream (using ranges)
>> by member fields, array elements, or characters of field names and string
>> values. It's possible to parse JSON without a single allocation. For
>> convenience, one can get objects, arrays and strings as a whole.
>>
>> I plan to add a streaming json writer and release it (currently it outputs
>> json using toString()). I've seen questions on stackoverflow about parsing
>> 500 MB JSON... so streaming feature makes it really universal. This approach
>> should be good for XML parser too.
>>
>> Currently, I don't have time to improve it. But if someone is interested I
>> can send it as is :-)
>
> I'm very interested in your json lib. I just started writing my own
> but you have more advanced stuff already so I'd better build something
> on top of your work. Is it on a repository somewhere on the web?

I just uploaded it here: 
https://github.com/pszturmaj/json-streaming-parser. Hope you like it :-)


More information about the Digitalmars-d-learn mailing list