-
Notifications
You must be signed in to change notification settings - Fork 123
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
Extremely slow prettyprinting for lists of tuples #1274
Comments
It looks like the slowdown does not occur in cryptol-2.7.0, cryptol-2.8.0, cryptol-2.10.0, or cryptol-2.11.0. |
I just finished doing a bisection. Git says that 35bb83b is the first bad commit. Turns out it's not evaluation, it's the prettyprinter. |
Profiling shows that function |
It appears that the exponential slowdown can be eliminated by replacing |
This avoids an exponential slowdown that occurs with `layoutSmart` in combination with nested lists or lists of tuples. Fixes #1274.
In the current master version (5a6f9a0) this expression takes 5 seconds to evaluate at the REPL on my machine:
The runtime is exponential in the length, doubling with each additional element in the list. Length 28 takes about 22 seconds on my machine.
The type of
x
doesn't seem to matter much. Changing the type toZ 30
also takes 5 seconds. At type[8]
it takes 13 seconds. Replacing one of thex
s with another expression likeTrue
or()
doesn't affect the time. The same slowdown occurs with a two-element record or a two-element array, although a one-element record or array makes it evaluate quickly. Going up to three elements makes it moderately slower (but definitely not 3^n slower).The text was updated successfully, but these errors were encountered: