From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Wondering about FACE_CACHE_BUCKETS_SIZE Date: Wed, 10 Feb 2021 18:11:18 +0200 Message-ID: <83mtwbj42h.fsf@gnu.org> References: <673E9F11-29F6-4F5B-B754-34FD9776DDB6@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25784"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Win Treese Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 10 17:18:54 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l9sCb-0006c8-Qt for ged-emacs-devel@m.gmane-mx.org; Wed, 10 Feb 2021 17:18:53 +0100 Original-Received: from localhost ([::1]:49352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9sCa-00079K-S9 for ged-emacs-devel@m.gmane-mx.org; Wed, 10 Feb 2021 11:18:52 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9s5H-0000rn-6P for emacs-devel@gnu.org; Wed, 10 Feb 2021 11:11:19 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:46224) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9s5F-0000Vm-Mn; Wed, 10 Feb 2021 11:11:18 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3644 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l9s5F-0000Md-41; Wed, 10 Feb 2021 11:11:17 -0500 In-Reply-To: <673E9F11-29F6-4F5B-B754-34FD9776DDB6@acm.org> (message from Win Treese on Tue, 9 Feb 2021 21:53:34 -0500) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:264295 Archived-At: > From: Win Treese > Date: Tue, 9 Feb 2021 21:53:34 -0500 > > > 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. Thanks, I changed that to 1009.