|
From: | Herman , Géza |
Subject: | Re: I created a faster JSON parser |
Date: | Tue, 19 Mar 2024 20:05:23 +0100 |
Mattias Engdegård <mattias.engdegard@gmail.com> writes:
15 mars 2024 kl. 14.35 skrev Herman, Géza <geza.herman@gmail.com>:Have you benchmarked it? I really doubt that there is a significant performance difference. Maybe it's possible to find some case, where this modification matters a bit, but for most cases, the difference should be negligible. The amount of allocations done is the same in both cases, which is for large files, only 20-30 allocations. Compared to the thousands of allocations for storing the actual Lisp objects.I implemented this idea, here is the latest version (now, object_workspace is a Lisp_Object):That's considerably slower than before, especially for small inputs, so it's probably a no-go.
Except for the very-very trivial cases, memory allocation is always necessary. I can lower the allocation sizes, but I don't think it's worth it. We're only talking about sizes of the KB range.Here are some remaining tasks:2. Don't allocate any temporary storage before you know that it's actually necessary.
3. Stop using the object_workspace when not required, which is everywhere except possibly when reading arrays into Lisp vectors.object_workspace is necessary whenever a JSON contains an object or array. So basically always.
[Prev in Thread] | Current Thread | [Next in Thread] |