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

Permanent memory space for a user-defined function #1248

Merged
merged 17 commits into from
Nov 20, 2023

Conversation

trueqbit
Copy link
Collaborator

@trueqbit trueqbit commented Nov 15, 2023

Instead of recreating a user-defined function on the "free store" each time it is used for calculations, the memory space is now allocated once together with the "proxy" object registered with SQLite, so that the user-defined function only needs to be reconstructed.

Additional features in this PR:

  • User-defined functions participate in operator overloading, just like expressions, colum pointers, and column aliases.
  • Possibility of passing arguments when constructing the user-defined function

Additional improvements in this PR:

  • Reorganized code around user-defined functions.
  • Simplified creating a tuple of arguments for user-defined function calls from a SQL query.
  • Replaced custom call() function by std::apply().

@trueqbit trueqbit requested a review from fnc12 November 15, 2023 19:36
@trueqbit trueqbit marked this pull request as draft November 16, 2023 08:55
dev/udf_proxy.h Show resolved Hide resolved
dev/udf_proxy.h Outdated Show resolved Hide resolved
dev/udf_proxy.h Outdated Show resolved Hide resolved
This approach is not cumbersome when it comes to raw storage and the possible memory requirements of the user-defined function classes, and therefore sticks to regular "new"/"delete" expressions.
@trueqbit trueqbit marked this pull request as ready for review November 17, 2023 20:22
@trueqbit trueqbit requested a review from fnc12 November 17, 2023 20:22
dev/storage_base.h Outdated Show resolved Hide resolved
dev/storage_base.h Outdated Show resolved Hide resolved
@trueqbit trueqbit merged commit e04f3ef into fnc12:dev Nov 20, 2023
1 check passed
@trueqbit trueqbit deleted the udf_allocate_once branch December 24, 2023 13:20
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