Wanted: Review manager for std.data.json

Sönke Ludwig via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 9 07:45:11 PDT 2015


Am 09.04.2015 um 15:20 schrieb Martin Nowak:
> On 04/09/2015 10:59 AM, Sönke Ludwig wrote:
>> As far as the profiler results can be trusted, a good chunk of the time
>> gets spent for reading individual bytes from memory, but there must be
>> something else low-level going on that make things this bad. However,
>> there is nothing fundamental in the structure/design that would cause
>> this, so I think spending more time with the profiler is the only
>> logical step now. Unfortunately my VTune license has expired and perf on
>> Linux makes the task quite a bit more involved.
>
> I didn't found too many issues.
>
> Most of the time is spent in parseJSONValue (looks like there are some
> expansive struct copies)
> https://github.com/s-ludwig/std_data_json/blob/1da3f828ae6c4fd7cac7f7e13ae9e51ec93e6f02/source/stdx/data/json/parser.d#L148

I'll have a look at the DOM part later. At the moment I'm looking at low 
level issues of the lexer. There is a lot of potential there, but it's a 
lot of detail work.

>
> and skipWhitespace. This function could really take some optimization,
> e.g. avoid UTF decoding.

All of the lexing work happens on str.representation instead of the 
string directly, so no decoding should happen there.

>
> https://github.com/s-ludwig/std_data_json/blob/1da3f828ae6c4fd7cac7f7e13ae9e51ec93e6f02/source/stdx/data/json/lexer.d#L345
>
> Libdparse has some optimized ASM function, might be useful.
> https://github.com/Hackerpilot/libdparse/blob/51b7d9d321aac0fcc4a9be99bbbed5db3158326c/src/std/d/lexer.d#L2233
>



More information about the Digitalmars-d mailing list