Optimising JSON parsing leads to wierd execution timings

Laeeth Isharc via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Mar 28 19:56:37 PDT 2017


On Monday, 27 March 2017 at 09:05:00 UTC, Seb wrote:
> On Saturday, 25 March 2017 at 06:53:58 UTC, xtreak wrote:
>> Hi,
>>
>> Sorry for the double post. I have asked a question at 
>> Stackoverflow regarding this : 
>> https://stackoverflow.com/questions/42992507/get-float-value-out-of-jsonvalue-in-dlang . I have a `rating` field that might have 3 which parses to JSONValue.integer or 3.4 which parses to JSONValue.floating and I need to use float. I was using exceptions that was causing the program to be slow as per the profile information. Now I have used an if clause as suggested by Adam in the answer. Though the execution time for the relevant function that used exceptions earlier reduced the program was still taking the same time.
>>
>> [...]
>
> If you need a fast JSON library, have a look at 
> https://github.com/tamediadigital/asdf or 
> https://github.com/s-ludwig/std_data_json

Or search forum for fastest Json parser in the world.  I use asdf 
though, which is fast enough and has a nice interface.



More information about the Digitalmars-d-learn mailing list