unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Wondering about FACE_CACHE_BUCKETS_SIZE
@ 2021-02-10  2:53 Win Treese
  2021-02-10  9:08 ` tomas
  2021-02-10 16:11 ` Eli Zaretskii
  0 siblings, 2 replies; 3+ messages in thread
From: Win Treese @ 2021-02-10  2:53 UTC (permalink / raw)
  To: emacs-devel


I happened to be looking at some code in src/xfaces.c on the trunk, and I
noticed this at lines 289-292:

/* Size of hash table of realized faces in face caches (should be a
   prime number).  */

#define FACE_CACHE_BUCKETS_SIZE 1001

1001 isn’t prime (it’s 7*11*13). A quick look at the hash table code
suggest that the main effect of it is to slow things down a little bit
because some hash buckets would get used more often than they
would be with a prime. 

From the git log, it’s been this way since the code was first committed
in 1999.

There’s probably no real problem here, except that the comment and
code don’t match. On the other hand, 997 and 1009 are nice nearby
primes if it really matters.

 - Win




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-10 16:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-10  2:53 Wondering about FACE_CACHE_BUCKETS_SIZE Win Treese
2021-02-10  9:08 ` tomas
2021-02-10 16:11 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).