GNU bug report logs - #79035
Remove micro-optimization for Funintern for performance

Previous Next

Package: emacs;

Reported by: Lynn Winebarger <owinebar <at> gmail.com>

Date: Thu, 17 Jul 2025 03:26:02 UTC

Severity: normal

Full log


Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lynn Winebarger <owinebar <at> gmail.com>
Cc: bug-gnu-emacs <at> gnu.org,
 Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>
Subject: Re: Remove micro-optimization for Funintern for performance
Date: Thu, 17 Jul 2025 11:09:21 -0400
> (lread.c): Remove static variable oblookup_last_bucket_number.  Removal
> appears to reduce execution time of obarray functions by about 6%, while
> the variable was only used to avoid a redundant lookup in the rarely
> called Funintern.

[ Actually, it's not even a full lookup that's avoided, it's only the
  computation of the hash index.  ]

Yeah, this static var is ugly, I'm in favor of removing it.

BTW, looking at the code of `Funintern` I get the impression that
`oblookup_considering_shorthand` is wrong when the argument is a symbol:
we should take shorthand into account only when passed a string.


        Stefan





This bug report was last modified 10 days ago.

Previous Next


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