-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Add benchmark framework to sway-lsp
#4927
Conversation
LGTM! Perhaps we should add some kind of developer documentation where it says we actually have benchmarks and how to run those? |
Some methods like I am also wondering if it is worth to serialize responses to |
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.
Awesome work!
If the benchmarks don't take too long to run, it would be cool to integrate the request benchmarks into CI with a script like this. We could detect any change in the compiler or LSP code that significantly slows things down.
Good point, will modify the benchmark to collect into a Vec for this one. |
Nice, yeah something like that could be cool to integrate into our CI down the track. Will have a think about what would be useful for us. |
I've added a page under the Engineering/LSP page in the internal Notion docs for now. We could perhaps add another .MD to this repo at some point if the need arrises. If you want to run them yourself just |
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.
Description
This PR adds a way to benchmark the LSP requests and
TokenMap
methods usingcriterion
. I've also added a large sway benchmark project that can be used when running benchmarks now and in the future to measure performance improvements.Here is the result of the benchmarks.
230ns10msrelated to #4901
Checklist
Breaking*
orNew Feature
labels where relevant.