Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Light-weight Attrs class using __slots__ #2178

Closed
bdbaddog opened this issue Jan 2, 2018 · 0 comments
Closed

Light-weight Attrs class using __slots__ #2178

bdbaddog opened this issue Jan 2, 2018 · 0 comments

Comments

@bdbaddog
Copy link
Contributor

bdbaddog commented Jan 2, 2018

This issue was originally created at: 2008-08-16 04:34:14.
This issue was reported by: pankrat.
pankrat said at 2008-08-16 04:34:14

The attached patch reduces the memory footprint of Attrs instances which are
associated with every Node object. Most Attrs() only store the 'shared'
attribute. Using slots avoids creating a dict just to hold this attribute. If
more information is stored in attributes, a dict is still created in the
dict slot.

The memory saved is not much (less than 100 Byte per Node object).

Requires Python 2.3 (due to the required dict slot).

pankrat said at 2008-08-16 04:35:16

Created an attachment (id=473)
New style slots class for Attrs

gregnoel said at 2008-08-19 12:35:55

Bug party triage.

dirkbaechle said at 2014-05-17 15:09:56

reassigning issue

bdbaddog said at 2015-10-01 19:18:17

Closing this is in 2.4.0 with Dirk's changes.

More information about this issue is at http://www.scons.org/wiki/LudwigHaehne/SlotClasses.

pankrat attached slot_attrs.patch at 2008-08-16 04:35:16.

New style slots class for Attrs

@bdbaddog bdbaddog added this to the 2.x milestone Jan 2, 2018
@bdbaddog bdbaddog closed this as completed Jan 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant