Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid calling slow
typeInferComplete
on already-typechecked terms.
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.
- Loading branch information