bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Dmitry Gutov
Subject: bug#21798: 25.0.50; [PATCH] Add support for retrieving paths to JSON elements
Date: Sun, 8 Nov 2015 18:16:32 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Thunderbird/42.0

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]