|
From: | Herman , Géza |
Subject: | Re: I created a faster JSON parser |
Date: | Fri, 08 Mar 2024 13:38:48 +0100 |
Eli Zaretskii <eliz@gnu.org> writes:
From: Herman, Géza <geza.herman@gmail.com> Date: Fri, 08 Mar 2024 11:27:16 +0100This parser runs 8-9x faster than the jansson based parser on mymachine (tested on clangd language server messages).How does it do that? Can you summarize the main ideas of your implementation, which make it so much faster?
My parser creates Lisp objects during parsing, there is no intermediate step as Emacs has with jansson. With jansson, there are a lot of allocations, which my parser doesn't have (my parser has only two buffers, which exponentially grow. There are no other allocations). But even ignoring performance loss because of mallocs (on my dataset, 40% of CPU time goes into malloc/free), I think parsing should be faster, so maybe jansson is not a fast parser in the first place.
[Prev in Thread] | Current Thread | [Next in Thread] |