Skip to content

Use IntMap to implement TypeEnv more efficiently #886

@brianhuffman

Description

@brianhuffman

PR #884 improved evaluation performance in the Cryptol REPL by using Data.IntMap instead of Data.Map to keep track of the value variables in the evaluation environment. A similar performance improvement is likely possible by switching the type variable portion of the environment (TypeEnv) to use IntMap as well.

type TypeEnv = Map.Map TVar (Either Nat' TValue)

One question is whether this can be done with a single IntMap, or will it require two maps (one for TVFree variables, and one for TVBound variables). Each of those constructors contains an Int as a unique ID, but I'm not sure if they are guaranteed to be disjoint from each other. Or maybe we need separate maps for another reason.

Metadata

Metadata

Assignees

Labels

performanceGeneral performance related issues.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions