diff options
author | Guido van Rossum <guido@python.org> | 1997-01-18 07:53:23 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-01-18 07:53:23 +0000 |
commit | 1e6e9a23688129b5b29fb8e8137f17617d22f483 (patch) | |
tree | 127bb53165c7abbad01669876df73d2ff493471f /Objects/mappingobject.c | |
parent | 3dfd53b4c83cc42e694a7c6e66678f2e7b0b1613 (diff) | |
download | cpython-git-1e6e9a23688129b5b29fb8e8137f17617d22f483.tar.gz |
Two speedup hacks. Caching the hash saves recalculation of a string's
hash value. Interning strings (which requires hash caching) tries to
ensure that only one string object with a given value exists, so
equality tests are one pointer comparison. Together, these can speed
the interpreter up by as much as 20%. Each costs the size of a long
or pointer per string object. In addition, interned strings live
until the end of times. If you are concerned about memory footprint,
simply comment the #define out here (and rebuild everything!).
Diffstat (limited to 'Objects/mappingobject.c')
0 files changed, 0 insertions, 0 deletions