Message81705
[Antoine]
> Ok, updated patch:
> - uses a 4-bit rotate (not shift)
> - avoids comparing an unsigned long to -1
> - tries to streamline the win64 special path (but I can't test)
pointer_hash4.patch looks fine to me. Still, I think it's worth
considering the simpler and faster: x |= x>>4. The latter doesn't
require any special-casing for various pointer sizes. It just works.
[Adam]
> Adding an arbitrary set of OR, XOR, or add makes me uneasy;
> I know enough to do them wrong (reduce entropy), but not
> enough to do them right.
It's easy enough to prove (just show that the function is reversible)
and easy enough to test:
assert len(set(ids)) == len(set(map(f, set(ids)))) # for any large
group of ids |
|
Date |
User |
Action |
Args |
2009-02-12 02:08:47 | rhettinger | set | recipients:
+ rhettinger, jcea, chemacortes, mark.dickinson, Rhamphoryncus, pitrou |
2009-02-12 02:08:47 | rhettinger | set | messageid: <1234404527.5.0.805516224345.issue5186@psf.upfronthosting.co.za> |
2009-02-12 02:08:46 | rhettinger | link | issue5186 messages |
2009-02-12 02:08:45 | rhettinger | create | |
|