Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate type-checking performance #12

Open
travisbrown opened this issue Apr 14, 2020 · 0 comments
Open

Investigate type-checking performance #12

travisbrown opened this issue Apr 14, 2020 · 0 comments
Labels

Comments

@travisbrown
Copy link
Owner

Right now the normalized Prelude type-checks ~instantaneously:

scala> import org.dhallj.syntax._
import org.dhallj.syntax._

scala> val path = "./dhall-lang/Prelude/package.dhall"
path: String = ./dhall-lang/Prelude/package.dhall

scala> val Right(prelude) = path.parseExpr.flatMap(_.resolve)
prelude: org.dhallj.core.Expr = {`Bool` = {and = let ...

scala> val normalized = prelude.normalize
normalized: org.dhallj.core.Expr = {`Bool` = {and = ...

scala> normalized.typeCheck
res0: Either[org.dhallj.core.typechecking.TypeCheckFailure,org.dhallj.core.Expr] = Right(...

If you don't normalize it, though, it takes a little over a minute:

scala> prelude.typeCheck
res1: Either[org.dhallj.core.typechecking.TypeCheckFailure,org.dhallj.core.Expr] = Right(...

It does produce the correct result, but something is obviously wrong. I haven't really looked into this yet, but I'm assuming it's because it's type-checking the same imported trees over and over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant