summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2019-06-05 21:24:18 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-06-06 15:53:43 +0000
commit8fae6d5f3182afdca1e27756d462960a1450a1d6 (patch)
tree4d9fa4a8685236951ea5aac39213dd240c2e0dac
parent8f6e36acea77b35f454a53383a94b8fb838957fd (diff)
downloadbuildstream-8fae6d5f3182afdca1e27756d462960a1450a1d6.tar.gz
_loader/types: Make Dependency a cdef class
Moving this class to Cython gives a non-negligeable speedup on 'show' operations.
-rw-r--r--src/buildstream/_loader/types.pyx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/buildstream/_loader/types.pyx b/src/buildstream/_loader/types.pyx
index 5e4e12666..de9d378e3 100644
--- a/src/buildstream/_loader/types.pyx
+++ b/src/buildstream/_loader/types.pyx
@@ -58,7 +58,12 @@ class Symbol():
# provenance (ProvenanceInformation): The YAML node provenance of where this
# dependency was declared
#
-class Dependency:
+cdef class Dependency:
+ cdef public _yaml.ProvenanceInformation provenance
+ cdef public str name
+ cdef public str dep_type
+ cdef public str junction
+
def __init__(self, dep, provenance, default_dep_type=None):
self.provenance = provenance