Skip to content
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

Codemirror benchmarks #150

Merged
merged 28 commits into from
Dec 8, 2023
Merged

Codemirror benchmarks #150

merged 28 commits into from
Dec 8, 2023

Conversation

OskarDamkjaer
Copy link
Collaborator

This PR includes two new github actions, one running on merged PR that records benchmarkresults to a grafana cloud instance and one job that compares main / pr benchmarks to warn if performance is decreased bellow a set threshold.

Note that the comparative github action will fail on this PR because there's no benchmarking script to compare with yet (as it's not merged yet). I tested the action comparing the PR to PR, which succeeded

.nvmrc Show resolved Hide resolved
@OskarDamkjaer OskarDamkjaer requested a review from ncordon December 7, 2023 08:56
@@ -220,7 +220,8 @@ class ParserWrapper {
parse(query: string): EnrichedParsingResult {
if (
this.parsingResult !== undefined &&
this.parsingResult.query === query
this.parsingResult.query === query &&
process.env.BENCHMARKING !== 'true'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of this cause if someone had this env variable defined (unlikely but still possible) then the behaviour of the language server changes.

I'd rather probably we had a method to clean the cache and we call that after every test of the benchmark?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wdyt about naming it something where it is more obvious the behavior of the language server changes, something like: BENCHMARK_CYPHER_LANGUAGE_SERVER?

I'm fine with having a method to clean the cache as well if you prefer

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wdyt about naming it something where it is more obvious the behavior of the language server changes, something like: BENCHMARK_CYPHER_LANGUAGE_SERVER?

I think explicitly cleaning the cache is a better idea IMO. The reason is right now I'm not sure whether this is benchmarking the right thing because in the auto-completion or the syntax validation we are also including another component, which is the parsing. So I'd rather we could control when to clean or not to clean the cache

Copy link
Collaborator

@ncordon ncordon Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm flexible, so if you prefer to do that on another PR, we can iterate on this. That way we get to test it out as well

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be nice to do in a follow up PR, just to see that the Github actions work

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went ahead and did it directly in this PR instead.

@OskarDamkjaer OskarDamkjaer requested a review from ncordon December 8, 2023 10:12
@@ -300,3 +300,7 @@ export function applySyntaxColouring(

return result;
}

export function clearCache() {
delete parserWrapper.parsingResult;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this call parserWrapper.clearCache instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It got in by mistake, thanks for catching it!

@OskarDamkjaer OskarDamkjaer merged commit 6e810cb into main Dec 8, 2023
3 of 4 checks passed
@OskarDamkjaer OskarDamkjaer deleted the codemirror-benchmarks branch December 8, 2023 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants