Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Innovation distinguishes between a leader and a follower. -- Steve Jobs (1955-2011)


devel / comp.lang.python / Re: Best practice for caching hash

SubjectAuthor
o Re: Best practice for caching hashCameron Simpson

1
Re: Best practice for caching hash

<mailman.317.1647434381.2329.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=17533&group=comp.lang.python#17533

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: cs...@cskk.id.au (Cameron Simpson)
Newsgroups: comp.lang.python
Subject: Re: Best practice for caching hash
Date: Wed, 16 Mar 2022 23:04:55 +1100
Lines: 14
Message-ID: <mailman.317.1647434381.2329.python-list@python.org>
References: <CAPTjJmrwMjiZcu7zMtR31dF2ekFReJhsCMa4zVpQ0RXELafGOQ@mail.gmail.com>
<YjHSZ2xQQuFmKHxU@cskk.homeip.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.uni-berlin.de LJwEZiGcY/POGCPT0Y1LygqFJzKD74F0bsUT5Yt1gRqQ==
Return-Path: <cameron@cskk.id.au>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.004
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'comments': 0.03; '2022':
0.05; 'mar': 0.07; 'angelico': 0.09; 'int': 0.09; 'cheers,': 0.11;
'(there': 0.16; 'cameron': 0.16; 'cpython': 0.16; 'from:addr:cs':
0.16; 'from:addr:cskk.id.au': 0.16; 'from:name:cameron simpson':
0.16; 'hash': 0.16; 'message-id:@cskk.homeip.net': 0.16;
'received:10.10': 0.16; 'simpson': 0.16; 'wrote:': 0.16; 'uses':
0.19; 'to:addr:python-list': 0.20; 'chris': 0.28; 'header:User-
Agent:1': 0.30; 'but': 0.32; 'subject:for': 0.33; 'header:In-
Reply-To:1': 0.34; 'wed,': 0.39; 'initial': 0.61; 'simply': 0.63;
'top': 0.65; 'received:userid': 0.66; 'stand': 0.67;
'header:Received:6': 0.67; 'management': 0.68; 'further': 0.69;
'slots': 0.69; 'interesting': 0.71
X-RG-Spam: Unknown
X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvvddrudefvddgfeefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuuffpveftpgfvgffnuffvtfetpdfqfgfvnecuuegrihhlohhuthemucegtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeffhffvuffkgggtuggjfghfsehttdertddtredvnecuhfhrohhmpeevrghmvghrohhnucfuihhmphhsohhnuceotghssegtshhkkhdrihgurdgruheqnecuggftrfgrthhtvghrnhepleevfeeghfeggfehuddvgfehhfffjeegvdeuiefhgeelgeekfeffiefguddtveehnecukfhppedurdduvdelrddvgeekrdelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehhvghlohepsghorhhgrdgtshhkkhdrhhhomhgvihhprdhnvghtpdhinhgvthepuddruddvledrvdegkedrledpmhgrihhlfhhrohhmpegtrghmvghrohhnsegtshhkkhdrihgurdgruhdpnhgspghrtghpthhtohepuddprhgtphhtthhopehphihthhhonhdqlhhishhtsehphihthhhonhdrohhrgh
X-RazorGate-Vade-Verdict: clean 0
X-RazorGate-Vade-Classification: clean
X-RG-VS-CLASS: clean
X-Authentication-Info: Submitted using ID cskk@bigpond.com
Mail-Followup-To: Python List <python-list@python.org>
Content-Disposition: inline
In-Reply-To: <CAPTjJmrwMjiZcu7zMtR31dF2ekFReJhsCMa4zVpQ0RXELafGOQ@mail.gmail.com>
User-Agent: Mutt/2.2.1 (2022-02-19)
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <YjHSZ2xQQuFmKHxU@cskk.homeip.net>
X-Mailman-Original-References: <CAPTjJmrwMjiZcu7zMtR31dF2ekFReJhsCMa4zVpQ0RXELafGOQ@mail.gmail.com>
 by: Cameron Simpson - Wed, 16 Mar 2022 12:04 UTC

On 16Mar2022 19:09, Chris Angelico <rosuav@gmail.com> wrote:
>On Wed, 16 Mar 2022 at 18:48, Cameron Simpson <cs@cskk.id.au> wrote:
>> This may be because the "raw" hash (in this case the int value) is
>> itself further hashed (giving more evenness) and then moduloed into the
>> finite number of slots in the dict.
>
>Not in a CPython dict, no. (There is some collision management that
>uses upper bits, but the initial selection of bucket simply uses the
>raw hash.) See comments at the top of dictobject.c.

Thank you, I stand corrected. That's a very interesting read.

Cheers,
Cameron Simpson <cs@cskk.id.au>

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor