Zannick / logic-graph

Tools for video game logic representation and analysis, particularly routing and beatability checks for speedruns and randomizers.
MIT License
3 stars 0 forks source link

Try out a rule evaluation cache #142

Open Zannick opened 6 months ago

Zannick commented 6 months ago

Since every access rule is evaluated against the state at the start of the step, we could cache them for some potential speed improvement. Most likely that would mainly benefit warps (which, for AV2, have a lot of the same or similar rules), since the number of spot-specific locations, exits, and actions is limited. Because of this, it's unclear whether this would provide a benefit.

This would involve making a rule evaluator that contains a mapping of rules to results, including both helpers and rules (though this would probably result in helpers not being macros)--each invocation of a helper or rule would first be checked against the mapping, and if not present, would be evaluated and stored.