diff options
author | Benjamin Schubert <contact@benschubert.me> | 2019-06-05 21:24:18 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-06-06 15:53:43 +0000 |
commit | 8fae6d5f3182afdca1e27756d462960a1450a1d6 (patch) | |
tree | 4d9fa4a8685236951ea5aac39213dd240c2e0dac /src/buildstream/_loader | |
parent | 8f6e36acea77b35f454a53383a94b8fb838957fd (diff) | |
download | buildstream-8fae6d5f3182afdca1e27756d462960a1450a1d6.tar.gz |
_loader/types: Make Dependency a cdef class
Moving this class to Cython gives a non-negligeable speedup on 'show'
operations.
Diffstat (limited to 'src/buildstream/_loader')
-rw-r--r-- | src/buildstream/_loader/types.pyx | 7 |
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 |