[Checkins] [zopefoundation/zope.interface] ab0466: Move Declaration, Specification and ClassProvides ...

Jason Madden noreply at github.com
Mon Jan 27 15:06:45 CET 2020


  Branch: refs/heads/master
  Home:   https://github.com/zopefoundation/zope.interface
  Commit: ab0466e56c6328407c3839a3a392cb127dbdb282
      https://github.com/zopefoundation/zope.interface/commit/ab0466e56c6328407c3839a3a392cb127dbdb282
  Author: Jason Madden <jamadden at gmail.com>
  Date:   2020-01-27 (Mon, 27 Jan 2020)

  Changed paths:
    M src/zope/interface/_zope_interface_coptimizations.c
    M src/zope/interface/declarations.py
    M src/zope/interface/interface.py
    M src/zope/interface/tests/test_declarations.py
    M src/zope/interface/tests/test_interface.py

  Log Message:
  -----------
  Move Declaration, Specification and ClassProvides to __slots__.

In a test of 6000 modules that load 2245 InterfaceClass objects and produce 2233 ClassProvides instances, this saves about 1% total memory usage in Python 2.7.


  Commit: 7f6638cf5113f9f6ecb51116bbb72fdbc3f3ce06
      https://github.com/zopefoundation/zope.interface/commit/7f6638cf5113f9f6ecb51116bbb72fdbc3f3ce06
  Author: Jason Madden <jamadden at gmail.com>
  Date:   2020-01-27 (Mon, 27 Jan 2020)

  Changed paths:
    M src/zope/interface/_zope_interface_coptimizations.c
    M src/zope/interface/interface.py

  Log Message:
  -----------
  Specifications with no dependents are common (4700 out of 7000 in this example), so avoid allocating a WeakKeyDictionary until needed.

This saves another 2% or so.


  Commit: 7a34a32a3b66073f91ffe978132ae71783a62630
      https://github.com/zopefoundation/zope.interface/commit/7a34a32a3b66073f91ffe978132ae71783a62630
  Author: Jason Madden <jamadden at gmail.com>
  Date:   2020-01-27 (Mon, 27 Jan 2020)

  Changed paths:
    M CHANGES.rst
    M src/zope/interface/interface.py

  Log Message:
  -----------
  Avoid allocating space for tagged values unless they're used. This saves another few percent.


  Commit: 2c359081237f5d8a87de223e32e380d83b4bd26f
      https://github.com/zopefoundation/zope.interface/commit/2c359081237f5d8a87de223e32e380d83b4bd26f
  Author: Jason Madden <jamadden at gmail.com>
  Date:   2020-01-27 (Mon, 27 Jan 2020)

  Changed paths:
    M src/zope/interface/_zope_interface_coptimizations.c

  Log Message:
  -----------
  Whitespace.


  Commit: fec4a51b1ce8526de23c2558bfd26e253c4b6250
      https://github.com/zopefoundation/zope.interface/commit/fec4a51b1ce8526de23c2558bfd26e253c4b6250
  Author: Jason Madden <jamadden at gmail.com>
  Date:   2020-01-27 (Mon, 27 Jan 2020)

  Changed paths:
    M CHANGES.rst
    M src/zope/interface/_zope_interface_coptimizations.c
    M src/zope/interface/declarations.py
    M src/zope/interface/interface.py
    M src/zope/interface/tests/test_declarations.py
    M src/zope/interface/tests/test_interface.py

  Log Message:
  -----------
  Merge pull request #155 from zopefoundation/slots

More memory optimizations for a 6-7% reduction.


Compare: https://github.com/zopefoundation/zope.interface/compare/eeaacb6d6a05...fec4a51b1ce8


More information about the checkins mailing list