-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
Optimization: cache semantic lookup in tokenizer, add semantic tokens bench marks #4069
base: master
Are you sure you want to change the base?
Conversation
could we have some benchmarks on large files to see if this actually makes a difference? |
WIth
|
Looks like a decent improvement. Could you add this benchmark to the ghcide-bench experiments please? |
the |
Sure, I will make some changes |
I need to take some more time to come up a more decent benchmark on this. Convert it to draft now. |
The overal improvement is not really obivious. Slightly better mem usage and speed.
|
After update to master, seems it does show decent improvement.
|
cc @wz1000 , I have produced some more accurate result, seems about 5% improvement to |
@@ -333,7 +333,7 @@ benchRules build MkBenchRules{..} = do | |||
++ concat | |||
[[ "-h" | |||
, "-i" <> show i | |||
, "-po" <> outHp | |||
, "-po" <> dropExtension outHp |
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.
In macos, the original produce duplicated suffix *.hp.hp
making the bench test failed.
dropExtension
fix it.
Bumps [pre-commit/action](https://github.com/pre-commit/action) from 3.0.0 to 3.0.1. - [Release notes](https://github.com/pre-commit/action/releases) - [Commits](pre-commit/action@v3.0.0...v3.0.1) --- updated-dependencies: - dependency-name: pre-commit/action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
FWIW I'm unsure if that's a big enough difference to make this worth it. It might be better just to keep the simpler code (we should definitely add the benchmark, though). Is the improvement bigger on bigger files? |
The bench is running on files with 2.5k and 1k lines of code in cabal package. agree,not much different since the current computation is relatively simple, perhaps I should turn it into draft and revisit this if/when more features are introduced that make the computation heavy. (btw, the semantic tokens bench and the bench fix are already included his-graph patch) |
It gains about 5% performance increasement to the GetSemanticTokens Rule.