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 Build/NodeInfo classes using __slots__ #2180

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

Light-weight Build/NodeInfo classes using __slots__ #2180

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 11:36:25.
This issue was reported by: pankrat.
pankrat said at 2008-08-16 11:36:25

The attached patch reduces the memory footprint of NodeInfoBase, BuildInfoBase
and derived classes which are associated with every Node object. Those were
turned into slotted classes.

The overall memory reduction is about 7-9%, but might be different depending on
the build configuration and project.

The pickling must be done manually and the format of the resulting sconsign
entries differ. It is possible to read existing sconsign databases. However,
once the sconsign database was emitted using slotted classes, it cannot be used
anymore from older versions of SCons (it's a one-way transition).

The constructor argument 'node' was removed as it wasn't used anywhere. The
(unused) version is not stored in each instance anymore, only written to the
sconsign database when pickled.

All affected tests were adapted to the changes. Some Alias tests still fail, due
to issue 2177.

Requires Python 2.3 (but can be back-ported to Python 2.2 by removing the
weakref slots).

pankrat said at 2008-08-16 11:38:06

Created an attachment (id=475)
Turn *Info classes into new-style slotted classes

pankrat said at 2008-08-16 13:28:29

Created an attachment (id=476)
Fixed patch now handles AliasInfo and also fixes sconsign tests

gregnoel said at 2008-08-19 12:38:47

Bug party triage.

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

reassigning issue

bdbaddog said at 2015-10-01 19:50:28

Dirk - I looked at the patches and if I'm not mistaken all of these changes are
encompassed in the slots branch merge to default. If so, please close this bug?

dirkbaechle said at 2015-10-06 12:39:58

Resolved with the merge at commit
https://bitbucket.org/scons/scons/commits/9965c5a4ecca51f6a1a62da6f172b91ae8d4f3e
5

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

pankrat attached slot_sconsign4.patch at 2008-08-16 11:38:06.

Turn *Info classes into new-style slotted classes

pankrat attached slot_sconsign5.patch at 2008-08-16 13:28:29.

Fixed patch now handles AliasInfo and also fixes sconsign tests

@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