-
Notifications
You must be signed in to change notification settings - Fork 24
Filterx: add_inplace() implementation for improved performance #863
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
Open
bazsi
wants to merge
9
commits into
axoflow:main
Choose a base branch
from
bazsi:filterx-inplace-add-for-improved-performance
base: main
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
Filterx: add_inplace() implementation for improved performance #863
bazsi
wants to merge
9
commits into
axoflow:main
from
bazsi:filterx-inplace-add-for-improved-performance
Conversation
This file contains hidden or 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
b63ba85 to
5db1d15
Compare
5db1d15 to
97edbb8
Compare
Merged
alltilla
reviewed
Jan 15, 2026
| { | ||
| FilterXOperatorPlusAssign *self = g_new0(FilterXOperatorPlusAssign, 1); | ||
| filterx_binary_op_init_instance(&self->super, "plus-assign", lhs, rhs); | ||
| self->super.super.eval = _eval_plus_assign; |
Member
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.
Don't we need ignore_falsy_result = TRUE?
| } | ||
|
|
||
| static FilterXObject * | ||
| _add_inplace(FilterXObject *lhs_object, FilterXObject *rhs_object) |
Member
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.
Can we do the same for sequence?
eb7e6f4 to
f771f97
Compare
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
…ject_add_object() The subject of all FilterXObject methods is an object anyway, so it does not add much value and is inconsistent. Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
The new method should perform changes on @self and return a ref to self if it was successful. If in-place addition fails for some reason, it can return an alternative object. Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
The FilterXRef object can absorb the returned valule by add_inplace(). If the value is the same object (e.g. inplace add was successful), we just return the same ref. If it was changed, then self->value is updated. Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
… one Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
f771f97 to
0af5515
Compare
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
…d goto This time, it is easier to just use an else block. Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Instead of an ugly `add_mode` property, use a specific method. Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
0af5515 to
1c2af1c
Compare
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.
Instead of having to clone, merge and then unref, this allows us to mutate dicts in place using the "+=" operator.