Subject: Re: bug#21798: 25.0.50; [PATCH] Add support for retrieving paths to JSON elements

From: Dmitry Gutov <[email-masked]>
Date: Sun, 8 Nov 2015 18:16:32 +0200

Hi again, Simen.

On 11/08/2015 02:32 PM, Simen Heggestøyl wrote:

> Yes, maybe they should. The only drawback I see is that 'json-read' then
> needs to accept an optional parameter, which is the JSON key of the
> current element.
>
> A revised patch implementing your suggestion is attached.

Thank you, but since `json-read' needs an optional argument in this case 
(which is not trivial to describe), I'd rather we go back to the 
previous patch.

How about renaming json-pre-read-function to 
json-pre-element-read-function, maybe? And same for the other one.

If you're fine with that, please install the result. (Or without the 
rename, it's up to you).

> Benchmarks follow below, with the usual setup!
>
> Before the patch:
>
> (benchmark-run 100 (json-read-from-string huge-json))
>       ⇒ (18.782874379000003 1007 5.674178575000008)
>
> After the patch:
>
> (benchmark-run 100 (json-read-from-string huge-json))
>       ⇒ (18.233328517999997 1007 4.907621599000008)

Nice! The extra code made it faster. :)

Apparently, the difference is within the margin of error.