-
Notifications
You must be signed in to change notification settings - Fork 195
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
HLint slow on larger files #983
Comments
Hi @phadej ! Can you please advise on your GHC version? Is it 8.10.1 by any chance? |
In the event it is, would you mind reporting your benchmark with an HLint built this way? cabal new-build --constraint "hlint +ghc-lib" --constraint "ghc-lib-parser-ex -auto" --constraint "ghc-lib-parser-ex -no-ghc-lib" I don't expect it to make a difference but still would be good to be sure. |
I’m using GHC-8.8.3 (HLint-2.0 was compiled with GHC-8.6.5)
… On 8. May 2020, at 15.39, Shayne Fletcher ***@***.***> wrote:
In the event it is, would you mind reporting your benchmark with an HLint built this way?
cabal new-build --constraint "hlint +ghc-lib" --constraint "ghc-lib-parser-ex -auto" --constraint "ghc-lib-parser-ex -no-ghc-lib"
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Thanks for the report and the test case. Profiling shows we burn about 12% lexing, 68% of the user-defined hints, 18% on the built-in hints. Zooming into the user-defined hints, 50% (of total runtime) goes into unifyExpr, of which 26% goes into scope matching. I've found and fixed a few super-low-hanging fruit (~0.3s), but it's mostly shuffling the time around a bit. What we really need to do is:
Naturally I'm keen to do the first step first, since optimising the wrong code can often make it harder to fix the right code. In the short term I don't think there will be many improvements though. |
Testing 3.2 vs 2.1.17, 3.2
2.1.17
|
Duplicate is gone as of #1150 and v3.2.1 so that shouldn't be an issue anymore. |
HLint 3.2.1
HLint 2.1.17
Interactive use of |
The two that are most impacted are the ones where Uniplate optimisations make the biggest differences. It's possible we've fallen off the Uniplate optimisations, which would explain the divergence. Worth checking. #712 might be the thing to investigate - turning on the Uniplate speed checker. |
See #1151 (comment) for some additional performance measurements. Match again seems an order of magnitude greater than the rest. |
So per "Flag matcher" the AST is traversed once right now? |
@mbj per AST node, all hints are traversed once is probably a more accurate way of saying it |
FWIW, this is till the case, and working on large files is still unacceptably slow:
It takes less time to compile that file with optimisations. |
In fact, it seems hlint got slower (I think I have the same machine still as when I opened this issue):
(to be fair, that file has grown a bit). |
With
hlint-3.1
:Where
hlint-2.0.15
:i.e. I see 3x regression in performance.
The text was updated successfully, but these errors were encountered: