-
Notifications
You must be signed in to change notification settings - Fork 379
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
[ fix #2202 ] Use SnocList in parser state to avoid quadratic slowdown #2203
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Can we please add the file that used to cause the slowdown as
a test in tests/idris2/perfXXX
?
Sure. I added it as perf2202 (to watch the ticket). I wasn't sure if we have permission to use the original program, so I just made a quick tool to generate a file with definitions likes: xNNN : Nat
xNNN = NNN I generated 10k definitions, which takes a bit under 2 minutes before my changes and about 10 seconds after them. If it's too much we could trim it down, but under about 5k definitions and the slowdown is less obvious. At least on my test machine. |
In my opinion, 2 seconds after your change and something notably slower before would be a sweet spot (10 seconds is a bit unfortunate when running the whole test suite locally to verify no regressions on a new branch). |
If you know how many definitions you want in the file, I can shorten it and update the PR, but the power adapter for the computer where I was doing this caught on fire today. I won't be able to get a replacement until sometime next week. But if you know how big you want the file I can easily make that change right through the github UI. Assuming the current algorithm is approximately linear, 2k definitions would be a good starting point for targeting 2seconds, but I don't know how obvious the regression will be at 2k. |
Let's take a stab at it and see where we land (your guess is as good as mine); we can see the resulting time in GitHub CI and use that as a gauge. |
Right, but it won't show us the regression timing. |
I cut it down to 2.5k but someone will need to reapprove the tests. |
I'll run the test on my machine against |
On my machine, the results with/without the fix are now: In my opinion, |
We are up to |
@AndrasKovacs can we use your file in the CI process to guard against regressions?
😱 |
@gallais Sure. |
@gallais are you requesting that the perf test get swapped out or just checking that we have permission to do so? I'm ok either way; having the test exhibit the perf fix and still not take too long with the newer fixed code is what is important to me. The worst thing that can happen in my opinion is to let this PR languish instead of getting the fix in. |
I'm in favour of adding both perf tests. I was planning to do it myself later this week |
I had to halve the file to keep the test time reasonable (~5s as opposed to ~15s whole) |
6380d0f
to
7ec6a50
Compare
No description provided.