Wanted: Review manager for std.data.json

Martin Nowak via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 9 06:20:34 PDT 2015


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

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

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