Benjamin Schubert pushed to branch bschubert/further-opti at BuildStream / buildstream
Commits:
-
3901584f
by Benjamin Schubert at 2019-02-05T17:48:58Z
1 changed file:
Changes:
... | ... | @@ -41,7 +41,7 @@ from .types import Symbol, Dependency |
41 | 41 |
# name (str): The element name
|
42 | 42 |
# loader (Loader): The Loader object for this element
|
43 | 43 |
#
|
44 |
-class LoadElement():
|
|
44 |
+class LoadElement:
|
|
45 | 45 |
# Dependency():
|
46 | 46 |
#
|
47 | 47 |
# A link from a LoadElement to its dependencies.
|
... | ... | @@ -53,10 +53,14 @@ class LoadElement(): |
53 | 53 |
# element (LoadElement): a LoadElement on which there is a dependency
|
54 | 54 |
# dep_type (str): the type of dependency this dependency link is
|
55 | 55 |
class _Dependency:
|
56 |
+ __slots__ = ["element", "dep_type"]
|
|
57 |
+ |
|
56 | 58 |
def __init__(self, element, dep_type):
|
57 | 59 |
self.element = element
|
58 | 60 |
self.dep_type = dep_type
|
59 | 61 |
|
62 |
+ __slots__ = ["node", "name", "full_name", "node_id", "deps_id", "dependencies", "_loader"]
|
|
63 |
+ |
|
60 | 64 |
next_id = 0b1
|
61 | 65 |
|
62 | 66 |
def __init__(self, node, filename, loader):
|
... | ... | @@ -66,8 +70,6 @@ class LoadElement(): |
66 | 70 |
#
|
67 | 71 |
self.node = node # The YAML node
|
68 | 72 |
self.name = filename # The element name
|
69 |
- self.full_name = None # The element full name (with associated junction)
|
|
70 |
- self.deps = None # The list of Dependency objects
|
|
71 | 73 |
self.node_id = self.get_id()
|
72 | 74 |
self.deps_id = 0b0
|
73 | 75 |
|
... | ... | @@ -75,7 +77,6 @@ class LoadElement(): |
75 | 77 |
# Private members
|
76 | 78 |
#
|
77 | 79 |
self._loader = loader # The Loader object
|
78 |
- self._dep_cache = None # The dependency cache, to speed up depends()
|
|
79 | 80 |
|
80 | 81 |
#
|
81 | 82 |
# Initialization
|