From 8fae6d5f3182afdca1e27756d462960a1450a1d6 Mon Sep 17 00:00:00 2001 From: Benjamin Schubert Date: Wed, 5 Jun 2019 21:24:18 +0100 Subject: _loader/types: Make Dependency a cdef class Moving this class to Cython gives a non-negligeable speedup on 'show' operations. --- src/buildstream/_loader/types.pyx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1