[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 Mark Dickinson
Mark Dickinson added the comment: Given the responses so far, I suggest closing this as rejected. -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9685 ___

[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

[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 rep...@bugs.python.org http://bugs.python.org/issue9685

[issue9685] tuples should remember their hash value

2013-01-07 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9685 ___

[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.

[issue9685] tuples should remember their hash value

2013-01-06 Thread Georg Brandl
Changes by Georg Brandl ge...@python.org: -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9685 ___ ___ Python-bugs-list

[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 rep...@bugs.python.org http://bugs.python.org/issue9685 ___

[issue9685] tuples should remember their hash value

2013-01-06 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: rhettinger - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9685 ___ ___

[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-05 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- nosy: +meador.inge ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9685 ___ ___ Python-bugs-list

[issue9685] tuples should remember their hash value

2013-01-04 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- components: +Interpreter Core type: resource usage - performance versions: +Python 3.4 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9685

[issue9685] tuples should remember their hash value

2010-10-31 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- assignee: rhettinger - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9685 ___

[issue9685] tuples should remember their hash value

2010-08-25 Thread David Albert Torpey
New submission from David Albert Torpey dt...@users.sourceforge.net: 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

[issue9685] tuples should remember their hash value

2010-08-25 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net 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

[issue9685] tuples should remember their hash value

2010-08-25 Thread Tim Peters
Tim Peters tim.pet...@gmail.com 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

[issue9685] tuples should remember their hash value

2010-08-25 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: FWIW, I'm -1 on this without a demonstrable improvement on some real-world cases. -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9685

[issue9685] tuples should remember their hash value

2010-08-25 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net 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

[issue9685] tuples should remember their hash value

2010-08-25 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: 2010/8/25 Raymond Hettinger rep...@bugs.python.org: 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