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

Add cache of query schemas to results view #3862

Merged
merged 5 commits into from
Dec 13, 2024
Merged

Conversation

alexet
Copy link
Contributor

@alexet alexet commented Dec 9, 2024

The pagination this does is slow as it scan to compute the index of each page. By caching we mostly only do the scanning once and then later we can change page quickly. Unfortunately we must clear the cache on sorting though as that may reuse an existing bqrs.

For very large result sets (my test had 20,000,000 tuples) this takes the time to change page from about 10s to seemingly instant to me (I didn't precisely measure this, I just looked at a clock to get 10s) making looking through sorted data for certain results much easier.

I also removed a call to bqrs info with a page size of zero. Actually passing the pageSize of zero to the cli would result in an error, but as 0 is falsy so we treat it the same as the case without a pagesize. It seems clearer to just not provide the argument.

I am not sure why the E2E tests are failing though so I may need help debugging that.

@alexet alexet force-pushed the alexet/bqrs-schema-cache branch from c04893c to 605712b Compare December 9, 2024 23:58
@alexet alexet force-pushed the alexet/bqrs-schema-cache branch from 605712b to 1982f52 Compare December 10, 2024 00:09
@alexet alexet marked this pull request as ready for review December 10, 2024 12:41
@alexet alexet requested a review from a team as a code owner December 10, 2024 12:41
@aeisenberg
Copy link
Contributor

I merged into main. The E2E tests should be fixed now.

@aeisenberg
Copy link
Contributor

Hmmm....maybe not.

@alexet
Copy link
Contributor Author

alexet commented Dec 12, 2024

I merged in main in another PR and got the same error: https://github.com/github/vscode-codeql/actions/runs/12282822206/job/34274881774?pr=3867

@koesie10
Copy link
Member

I merged in main in another PR and got the same error: https://github.com/github/vscode-codeql/actions/runs/12282822206/job/34274881774?pr=3867

It is currently expected to fail due to a limitation in the E2E tests: they always install the released version, while the tests are testing the current version on the branch. See #3853. The E2E tests are not required, so they can be ignored.

@aeisenberg
Copy link
Contributor

We need to do a new extension release in order to get the tests passing again. See #3869.

Copy link
Contributor

@aeisenberg aeisenberg left a comment

Choose a reason for hiding this comment

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

Looks good (after updating the changelog).

extensions/ql-vscode/CHANGELOG.md Outdated Show resolved Hide resolved
Comment on lines +59 to +63
if (this.generation !== origGeneration) {
// Cache was reset in the meantime so don't trust this
// result enough to cache it.
return result;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice.

Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
@alexet alexet enabled auto-merge (squash) December 13, 2024 16:49
@alexet alexet merged commit 07e9e44 into main Dec 13, 2024
31 of 32 checks passed
@alexet alexet deleted the alexet/bqrs-schema-cache branch December 13, 2024 17:05
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.

3 participants