From: Dmitry Gutov <dgutov@yandex.ru>
To: "Simen Heggestøyl" <simenheg@gmail.com>
Cc: 21798@debbugs.gnu.org
Subject: bug#21798: 25.0.50; [PATCH] Add support for retrieving paths to JSON elements
Date: Tue, 3 Nov 2015 04:00:56 +0200 [thread overview]
Message-ID: <56381558.7050607@yandex.ru> (raw)
In-Reply-To: <1446420466.13180.0@smtp.gmail.com>
Hello Simen,
On 11/02/2015 01:27 AM, Simen Heggestøyl wrote:
> I managed to produce a benchmark with the following JSON file (560K,
> ~10,000 lines): http://folk.uio.no/simenheg/huge.json.
>
> I read it into `huge-json', and ran the following before the patch: ...
Thanks. In my testing, too, the difference seems to be statistically
insignificant. That's good.
I have to say, I'm still not very comfortable with mixing it sort of
alien logic inside json-read-object and json-read-array (would anyone
else like to chime in with their opinion?).
I do believe we want this functionality, though. One option to tighten
the implementation is to extract common pieces from json-read-object and
json-read-array, and implement two new functions using them, but the
while-loops used there will make avoiding just copying code somewhat
difficult.
Here's an idea: both json-read-object-1 and json-read-array-2 will
advise json-read to add the new logic around calls to it (there will
have to be some guard in the advice, so that recursive calls are run
unmodified).
And json-path-to-position will locally modify json-readtable to use
json-read-object-1 and json-read-array-2.
That's just a suggestion, though.
next prev parent reply other threads:[~2015-11-03 2:00 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-31 8:46 bug#21798: 25.0.50; [PATCH] Add support for retrieving paths to JSON elements Simen Heggestøyl
2015-10-31 14:23 ` Dmitry Gutov
2015-11-01 19:52 ` Simen Heggestøyl
2015-11-01 23:27 ` Simen Heggestøyl
2015-11-03 2:00 ` Dmitry Gutov [this message]
2015-11-06 16:31 ` Simen Heggestøyl
2015-11-06 17:15 ` Dmitry Gutov
2015-11-07 13:23 ` Richard Stallman
2015-11-07 13:43 ` Dmitry Gutov
2015-11-07 18:50 ` Simen Heggestøyl
2015-11-07 19:18 ` Dmitry Gutov
2015-11-08 12:32 ` Simen Heggestøyl
2015-11-08 12:34 ` Simen Heggestøyl
2015-11-08 16:16 ` Dmitry Gutov
2015-11-08 21:12 ` Simen Heggestøyl
2015-11-09 0:20 ` Dmitry Gutov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56381558.7050607@yandex.ru \
--to=dgutov@yandex.ru \
--cc=21798@debbugs.gnu.org \
--cc=simenheg@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.