Skip to content

Optimize MCP assoc lists #572

@sim642

Description

@sim642

MCP extensively uses assoc lists to represent a dynamic product of analyses (i.e. their domain elements, contexts, etc). Manipulating these involves lots of assoc calls to look up corresponding analysis values in other lists. From profiling I have noticed this have a nontrivial impact where List.assoc takes ~10% of Goblint's total runtime!

Assoc lists are famously not performance-oriented, so it makes sense to improve this. Currently I see two possibilities:

  1. Replace assoc lists with Map.
  2. Ensure well-defined and consistent order of elements (e.g. sorted by analysis index) in the assoc lists such that operations can just zip two/three of those lists together. This would allow manipulating corresponding elements pairwise without having to do assoc calls.

Metadata

Metadata

Assignees

Labels

cleanupRefactoring, clean-upperformanceAnalysis time, memory usage

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions