1 Jun 02:24 2001

### RE: One more dict trick

Tim Peters <tim.one <at> home.com>

2001-06-01 00:24:01 GMT

2001-06-01 00:24:01 GMT

Another version of the patch attached, a bit faster and with a large new comment block explaining it. It's looking good! As I hope the new comments make clear, nothing about this approach is "a mystery" -- there are explainable reasons for each fiddly bit. This gives me more confidence in it than in the previous approach, and, indeed, it turned out that when I*thought*"hmm! I bet this change would be a little faster!", it actually was <wink>.

Index: Objects/dictobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/dictobject.c,v retrieving revision 2.96 diff -c -r2.96 dictobject.c(Continue reading)*** Objects/dictobject.c 2001/05/27 07:39:22 2.96 --- Objects/dictobject.c 2001/06/01 00:17:07****************** 12,123**** */ #define MINSIZE 8 ! /* define this out if you don't want conversion statistics on exit */ #undef SHOW_CONVERSION_COUNTS /* ! Table of irreducible polynomials to efficiently cycle through ! GF(2^n)-{0}, 2<=n<=30. A table size is always a power of 2. ! For a table size of 2**i, the polys entry is 2**i + j for some j in 1 thru ! 2**i-1 inclusive. The polys[] entries here happen to add in the smallest j ! values "that work". Work means this: given any integer k in 1 thru 2**i-1