mal-lang / mal-toolbox

Apache License 2.0
4 stars 2 forks source link

Optimize lookups with dicts instead of lists #50

Open mrkickling opened 5 months ago

mrkickling commented 5 months ago

Everywhere where we use next() on lists to fetch assets/nodes/objects by name/id/something else we could use dict lookups instead to decrease time complexity to O(1) instead of O(n),

It should be done in all parts of the code where we search for objects by some attribute and where it is possible and sane to change it into a dict lookup. E.g. LanguageGraph, AttackGraph, perhaps model if not already solved.