-
Notifications
You must be signed in to change notification settings - Fork 14
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
optimized filtering #21
Open
nvdk
wants to merge
8
commits into
mu-semtech:master
Choose a base branch
from
nvdk:feature/optimized-filtering
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this greatly reduces the size of delta messages in stacks with large data changes.
65ce8d9
to
1854db3
Compare
this tries to optimize filtering and match detection in two ways: - by grouping on match pattern: this means we only do detection and filtering once for a given match pattern (takes the pattern and sendMatchesOnly into account) - by doing matching before origin filter, since the latter seems more costly
1854db3
to
34004ff
Compare
this is not the prettiest of solutions, but it does achieve the same thing. bonus is it only happens once on startup
it's mentioned in the expressjs best practices (and elsewhere) that process.env should be used sparingly: | If you need to write environment-specific code, you can check the value of NODE_ENV with process.env.NODE_ENV. Be aware that checking the value of any environment variable incurs a performance penalty, and so should be done sparingly. https://expressjs.com/th/advanced/best-practice-performance.html#set-node_env-to-production it seems this is because process.env is a getter that processes the ENV array each time
nvdk
commented
Jan 23, 2025
} | ||
} else { | ||
if (process.env["DEBUG_DELTA_SEND"] || process.env["DEBUG_DELTA_NOT_SENDING_EMPTY"]) | ||
if (DEBUG_DELTA_SEND || DEBUG_DELTA_NOT_SENDING_EMPTY) | ||
console.log(`Changeset empty. Not sending to ${entry.callback.method} ${entry.callback.url}`); |
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.
I kept this, but I don't think this situation can occur.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
builds on #20, but has some optimizations wrt to filtering:
options.sendMatchesOnly
into account as a grouping key)edit: can be tested using
nvdk/mu-delta-notifier:feature-optimized-filtering
. see https://github.com/lblod/app-lblod-harvester/pull/79/files for an example