Subject: bug#68244: hash-table improvements

From: "Basil L. Contovounesios" <[email-masked]>
Date: Sun, 21 Jan 2024 14:03:47 +0100

Mattias Engdegård [2024-01-04 17:27 +0100] wrote:

> It's the hash-table's turn to be subjected to some performance tuning.

Thanks!

> The implementation has changed very little over the years and it's not
> so much a matter of a single big thing to fix as many small ones, so
> the list of changes is fairly long but ever little helps.

João, is this tiny additional straw okay for the camel's back?

>From 359e5d5b90754373ff8a2db6431421d7838c113b Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <[email-masked]>
Date: Fri, 19 Jan 2024 13:50:29 +0100
Subject: [PATCH] Further shrink eglot--{}

Up to and including Emacs 29, :size 0 was an alias for :size 1.
Emacs 30 gained support for :size 0 hash tables (bug#68244).

* lisp/progmodes/eglot.el (eglot--{}): Define as truly zero-sized.
---
 lisp/progmodes/eglot.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index c5cfdd3cedd..511000927cf 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -575,7 +575,7 @@ eglot--tag-faces
 
 (defvaralias 'eglot-{} 'eglot--{})
 
-(defconst eglot--{} (make-hash-table :size 1) "The empty JSON object.")
+(defconst eglot--{} (make-hash-table :size 0) "The empty JSON object.")
 
 (defun eglot--executable-find (command &optional remote)
   "Like Emacs 27's `executable-find', ignore REMOTE on Emacs 26."
-- 
2.43.0

-- 
Basil