summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.rst7
-rw-r--r--src/zope/interface/declarations.py3
2 files changed, 7 insertions, 3 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index cfb52d4..ad7140b 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -54,6 +54,13 @@
fields in your subclass before attempting to hash or sort it. See
`issue 157 <https://github.com/zopefoundation/zope.interface/issues/157>`_.
+- Remove unneeded overwrite and call to anyway inherited `__hash__` method
+ from `.declarations.Implements` class. Watching a reindex index process in
+ ZCatalog with on a Py-Spy after 10k samples the time for `.adapter._lookup`
+ was reduced from 27.5s to 18.8s (~1.5x faster). Overall reindex index time
+ shrunk from 369s to 293s (1.26x faster). See
+ `PR 161 <https://github.com/zopefoundation/zope.interface/pull/161>`_.
+
4.7.1 (2019-11-11)
==================
diff --git a/src/zope/interface/declarations.py b/src/zope/interface/declarations.py
index 83f424c..63b09fd 100644
--- a/src/zope/interface/declarations.py
+++ b/src/zope/interface/declarations.py
@@ -223,9 +223,6 @@ class Implements(Declaration):
# This spelling works under Python3, which doesn't have cmp().
return (n1 > n2) - (n1 < n2)
- def __hash__(self):
- return Declaration.__hash__(self)
-
# We want equality to be based on identity. However, we can't actually
# implement __eq__/__ne__ to do this because sometimes we get wrapped in a proxy.
# We need to let the proxy types implement these methods so they can handle unwrapping