-
-
Notifications
You must be signed in to change notification settings - Fork 251
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
#[pg_guard] cleanup #526
#[pg_guard] cleanup #526
Conversation
Add a new function to pgx-pg-sys, `create::submodules::postgres_function_guard()` and teach the `#[pg_guard]` macro to use that function instead of duplicating all the sigsetjmp code for every function.
…writer` from build.rs. Also eliminate a bit of cloning from build.rs as well. This drastically improves pgx-pg-sys build times. On my machine, a clean build of the crate goes from ~36s to ~18s. And subsequent rebuilds (where build.rs doesn't run) goes from ~8s to ~2.4s
…tions, which decreases subsequent pgx-pg-sys rebuilds (where build.rs needs to run) by ~50%.
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.
Other than the (I think) dead code and sorting behavior question, this looks good!
Does this improve build time at all? If so I'd love to have a sample I could snippet for the release notes.
Yes, on my machine a rebuild of It's quite significant. |
Way to go! I'm happy to see this merge, you seem to have a couple pending todos according to comments though! |
This centralizes all the code
#[pg_guard]
otherwise generates into a common function, which takes a closure that is a wrapper around the desired internal Postgres function call.