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

minimize memory allocations in sanitize #2124

Open
vtolstov opened this issue Sep 19, 2024 · 5 comments
Open

minimize memory allocations in sanitize #2124

vtolstov opened this issue Sep 19, 2024 · 5 comments
Labels

Comments

@vtolstov
Copy link

I'm using pgbouncer with pgx and saw many memory allocs in internal/sanitize packages.
Did you mind to use simple buffer pool for this https://github.com/jackc/pgx/blob/v4.18.3/internal/sanitize/sanitize.go#L29

So you can use already allocated buffer and reuse it all the time, so we can minimise garbage collector cpu time and also minimise memory usage.

@vtolstov vtolstov added the bug label Sep 19, 2024
@jackc
Copy link
Owner

jackc commented Sep 19, 2024

v4 is not getting any changes except bug fixes.

@vtolstov
Copy link
Author

What about v5 ?

@jackc
Copy link
Owner

jackc commented Sep 20, 2024

Yes, it would be reasonable for v5.

@ninedraft
Copy link
Contributor

If no one minds, I'd like to address this issue.

@vtolstov
Copy link
Author

vtolstov commented Oct 1, 2024

@ninedraft if you have free time this will be very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants