[issue9685] tuples should remember their hash value

2020-03-15 Thread Anthony Sottile
Anthony Sottile added the comment: hit this today unfortunately -- I'm working with some pretty complex (and nested) `typing.NamedTuple` objects and the lack of caching here results in quite the slowdown (in my macro benchmarks it's the difference between a render pass taking 180ms and 25ms)

[issue9685] tuples should remember their hash value

2013-01-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 17038de56fd4 by Christian Heimes in branch 'default': Add a comment about *not* caching the hash value. Issue #9685 suggested to memorize the hash value, but the feature request was rejected because no speed ups were found. http://hg.python.org/cpy

[issue9685] tuples should remember their hash value

2013-01-07 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- resolution: -> rejected status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue9685] tuples should remember their hash value

2013-01-07 Thread Georg Brandl
Georg Brandl added the comment: Still, actual benefits in some kind of benchmark will be needed to show that this is not a premature optimization. -- ___ Python tracker ___ _

[issue9685] tuples should remember their hash value

2013-01-07 Thread Christian Heimes
Christian Heimes added the comment: I'm not too worried about the slightly increased memory usage. For example one of our largest application instances consumes about 8 GB memory right now. It has just about 22k tuples in gc.get_objects(). An additional Py_hash_t in tuple's struct would increa

[issue9685] tuples should remember their hash value

2013-01-07 Thread Mark Dickinson
Mark Dickinson added the comment: Given the responses so far, I suggest closing this as rejected. -- nosy: +mark.dickinson ___ Python tracker ___ _

[issue9685] tuples should remember their hash value

2013-01-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: My apologies once again, Raymond. I mistakenly thought that I unassigned the issue from you (it was a Roundup bug at this day). As for the issue, I totally agree with Tim. -- ___ Python tracker

[issue9685] tuples should remember their hash value

2013-01-06 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: rhettinger -> ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:

[issue9685] tuples should remember their hash value

2013-01-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, Raymond. It was a bad day for Roundup. -- assignee: -> rhettinger nosy: +serhiy.storchaka ___ Python tracker ___ __

[issue9685] tuples should remember their hash value

2013-01-06 Thread Georg Brandl
Changes by Georg Brandl : -- nosy: +georg.brandl ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue9685] tuples should remember their hash value

2013-01-05 Thread Meador Inge
Changes by Meador Inge : -- nosy: +meador.inge ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue9685] tuples should remember their hash value

2013-01-04 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Interpreter Core type: resource usage -> performance versions: +Python 3.4 -Python 3.2 ___ Python tracker ___ ___

[issue9685] tuples should remember their hash value

2010-10-31 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: rhettinger -> ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:

[issue9685] tuples should remember their hash value

2010-08-25 Thread Benjamin Peterson
Benjamin Peterson added the comment: 2010/8/25 Raymond Hettinger : > I suppose we could prepare a patch, instrument it, and try it with Twisted, > SQLalchemy, and Django to find-out how many tuple hash calculations would be > saved by memoizing. You should also check memory usage. --

[issue9685] tuples should remember their hash value

2010-08-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: Hello Tim! If you have a chance, please also take a look at issue9685 which I was planning to work on in the next couple of weeks. For memoizing tuple hashes, I'm inclined to think the one extra field is worth it. That would help all the cases where peopl

[issue9685] tuples should remember their hash value

2010-08-25 Thread Benjamin Peterson
Benjamin Peterson added the comment: FWIW, I'm -1 on this without a demonstrable improvement on some real-world cases. -- nosy: +benjamin.peterson ___ Python tracker ___ ___

[issue9685] tuples should remember their hash value

2010-08-25 Thread Tim Peters
Tim Peters added the comment: - Tuple objects don't currently reserve space to store their hash code, so it's likely this would increase the size of every tuple. - It's unclear to me which natural use patterns would actually enjoy a major speed boost. Note that dicts remember the hash codes

[issue9685] tuples should remember their hash value

2010-08-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: This seems reasonable. Will look at it in the next few days. -- assignee: -> rhettinger keywords: +easy nosy: +rhettinger priority: normal -> low stage: -> needs patch versions: +Python 3.2 -Python 2.6 ___ Pyth

[issue9685] tuples should remember their hash value

2010-08-25 Thread David Albert Torpey
New submission from David Albert Torpey : Dictionary keys are commonly numbers, strings, or tuples. Python has optimized numbers and strings to remember their hash values on successive calls. Tuples should do this too since their recursive hash function can take a long time to compute. Tuples