[Checkins] [zopefoundation/zope.interface] 3cc593: Use tp_members in SpecificationBase and ClassProvi...
noreply at github.com
Wed Jan 22 16:32:20 CET 2020
Author: Jason Madden <jamadden at gmail.com>
Date: 2020-01-22 (Wed, 22 Jan 2020)
Use tp_members in SpecificationBase and ClassProvidesBase.
Instead of storing 1 and 2 attributes, respectively, in __dict__. This lets us eliminate inst_attr and its use of an undocumented API.
It also helps reign in the size of these objects. Before, on CPython 8, a ClassProvides object that subclasses both SpecificationBase and ClassProvidesBase required 408 bytes: 48 for the object, 360 for the dict.
Now it requires 72 + 232 = 304.
With a bit of work on defining __slots__ in Python, that can be brought much lower still, I think.
zope.security tests pass with this installed.
More information about the checkins