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

filterx/expr-function: avoid using GPtrArray in simple functions #432

Conversation

bazsi
Copy link
Member

@bazsi bazsi commented Dec 30, 2024

Instead of passing the arguments in a GPtrArray, let's use a simple stack allocated array, voiding a 2 mallocs and 2 frees in any simple function invocations.

@bazsi bazsi force-pushed the filterx-use-plain-arrays-in-simple-function-args branch 2 times, most recently from a836dd3 to 78368d0 Compare December 30, 2024 14:53
…mentation

Instead of passing the arguments in a GPtrArray, let's use a simple stack
allocated array, voiding a 2 mallocs and 2 frees in any simple function
invocations.

Signed-off-by: Balazs Scheidler <[email protected]>
@bazsi bazsi force-pushed the filterx-use-plain-arrays-in-simple-function-args branch from 78368d0 to a154b3e Compare January 6, 2025 15:59
@alltilla alltilla requested a review from bshifter January 7, 2025 10:05
Copy link
Member

@bshifter bshifter left a comment

Choose a reason for hiding this comment

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

This approach seems to work well. If I hadn’t suggested using GPtrArray back then, this probably would have been my initial approach. It’s a straightforward solution, and while I think the performance improvement is minor, it’s still a cleaner and more efficient choice.

@bshifter bshifter merged commit 99c6ed2 into axoflow:main Jan 7, 2025
22 checks passed
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