GNU bug report logs - #78162
[PATCH] hash-table-contains-p: Avoid creating a symbol on every call

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Wed, 30 Apr 2025 10:04:02 UTC

Severity: normal

Tags: patch

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Daniel Mendler <mail <at> daniel-mendler.de>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 78162 <at> debbugs.gnu.org, pipcet <at> protonmail.com, stefankangas <at> gmail.com
Subject: bug#78162: [PATCH] hash-table-contains-p: Avoid creating a symbol on every call
Date: Sat, 10 May 2025 13:19:10 +0300
> Cc: 78162 <at> debbugs.gnu.org, Stefan Kangas <stefankangas <at> gmail.com>
> Date: Thu, 01 May 2025 17:37:19 +0200
> From:  Daniel Mendler via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> Pip Cet <pipcet <at> protonmail.com> writes:
> 
> > "Daniel Mendler" <mail <at> daniel-mendler.de> writes:
> >
> >> Pip Cet <pipcet <at> protonmail.com> writes:
> >>
> >>> "Daniel Mendler via \"Bug reports for GNU Emacs, the Swiss army knife of text editors\"" <bug-gnu-emacs <at> gnu.org> writes:
> >>>
> >>>> Tags: patch
> >>>>
> >>>> For performance reasons avoid creating a symbol on every call to
> >>>> `hash-table-contains-p'.  See also https://github.com/emacs-compat/compat/issues/71.
> >>>
> >>> If the performance of hash-table-contains-p is an issue, we should
> >>> reimplement it in C, which can use magic values which aren't accessible
> >>> from Lisp.
> >>
> >> For a proper hash table I expect this function to be efficient and not
> >> allocate.
> >
> > C would work, then.  As it avoids both your performance concerns and my
> > concerns about leaking magic values to Lisp, how about this?
> 
> Looks good. Thanks.

Stefan, any comments to the patch?




This bug report was last modified 12 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.