emacs-devel
[Top][All Lists]
Advanced

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

Re: I created a faster JSON parser


From: Herman , Géza
Subject: Re: I created a faster JSON parser
Date: Fri, 15 Mar 2024 14:35:10 +0100


Gerd Möllmann <gerd.moellmann@gmail.com> writes:

Mattias Engdegård <mattias.engdegard@gmail.com> writes:

There are some options. `record_unwind_protect_ptr_mark` would be one, and it was made for code like this, but Gerd has been grumbling about it lately. Perhaps it's easier just to disable GC in the dynamic scope
(inhibit_garbage_collection).

Yes, I'm grumbling because record_..._mark assumes GC is mark-sweep. And
it's really super ugly to work around.

And if you disable GC, I'll be grumbling because that's not good for a
concurrent GC.

What do I propose: If you can, please make objects reachable from the control stack. For instance, create a context object on the stack that has a Lisp vector member. That will prevent GC'ing the vector and by that its contents, of course. You could pass a pointer to the context around to get access to the vector in subroutines, replace it with a
larger vector if necessary, and so on.

I implemented this idea, here is the latest version (now, object_workspace is a Lisp_Object):

https://github.com/geza-herman/emacs/commit/12decaddc9b8260745be4d5782fea21f4578eab2.patch

Is there anything that need to be done?



reply via email to

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