diff options
author | Raymond Hettinger <python@rcn.com> | 2005-08-11 07:58:45 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2005-08-11 07:58:45 (GMT) |
commit | c991db240ca8ea838c6acb0c8dc5300dca23c39e (patch) | |
tree | b9b4faf8eb589db00390913a6f6d9af56f5df84a /Include/pgenheaders.h | |
parent | 9f3ae3e69d436f474bf46b802d514013807bca18 (diff) | |
download | cpython-c991db240ca8ea838c6acb0c8dc5300dca23c39e.zip cpython-c991db240ca8ea838c6acb0c8dc5300dca23c39e.tar.gz cpython-c991db240ca8ea838c6acb0c8dc5300dca23c39e.tar.bz2 |
* Add short-circuit code for in-place operations with self (such as
s|=s, s&=s, s-=s, or s^=s). Add related tests.
* Improve names for several variables and functions.
* Provide alternate table access functions (next, contains, add, and discard)
that work with an entry argument instead of just a key. This improves
set-vs-set operations because we already have a hash value for each key
and can avoid unnecessary calls to PyObject_Hash(). Provides a 5% to 20%
speed-up for quick hashing elements like strings and integers. Provides
much more substantial improvements for slow hashing elements like tuples
or objects defining a custom __hash__() function.
* Have difference operations resize() when 1/5 of the elements are dummies.
Formerly, it was 1/6. The new ratio triggers less frequently and only
in cases that it can resize quicker and with greater benefit. The right
answer is probably either 1/4, 1/5, or 1/6. Picked the middle value for
an even trade-off between resize time and the space/time costs of dummy
entries.
Diffstat (limited to 'Include/pgenheaders.h')
0 files changed, 0 insertions, 0 deletions