-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
perf: move id.eq fast path handling to node-model so it's shared between query running strategies #34520
Conversation
…ween query running strategies
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.
LGTM! Nice catch!
Object.keys(query.filter.id).length === 1 | ||
) { | ||
if (tracer) { | ||
runQueryActivity = reporter.phantomActivity(`runQuerySimpleIdEq`, { |
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.
What's the goal of this phantomActivity? To see it in tracing?
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.
Yes, just for instrumentation. This code path skips runQuery
activity, so I replaced it with something so traces make more sense
Woot! |
…ween query running strategies (gatsbyjs#34520)
Description
It seems we lost our fast path for simple
id.eq
queries and only had a path like that for LMDB (experimental) indexes. I moved this to much earlier in the pipeline (node-model).This should mean fast filters WON'T create a lookup table for it. The idea here is to limit the usage of it where possible, as (right now) those lookup tables cause nodes to be retained in memory and also not needed as we can already grab nodes by id.
Related Issues
[sc-44551]