Skip to content
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.

Avoid calling slow typeInferComplete on already-typechecked terms. #127

Merged
merged 1 commit into from
Jan 21, 2021

Conversation

brianhuffman
Copy link
Contributor

This fixes a performance problem that was exposed by #118:
typeInferComplete is actually very slow when called on
Constant terms, because instead of using the cached type,
it rechecks the well-formedness of the constant's definition.
Furthermore, its memoization for observable sharing is mostly
ineffective, because it resets the memo table whenever it
looks under a binder.

Switching from typeInferComplete to scTypeOf brings the
saw-script start-up time back to where it was before #118.

This fixes a performance problem that was exposed by #118:
`typeInferComplete` is actually very slow when called on
`Constant` terms, because instead of using the cached type,
it rechecks the well-formedness of the constant's definition.
Furthermore, its memoization for observable sharing is mostly
ineffective, because it resets the memo table whenever it
looks under a binder.

Switching from `typeInferComplete` to `scTypeOf` brings the
saw-script start-up time back to where it was before #118.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant