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

Optimize SASL auth in sqlx-postgres #3050

Merged
merged 2 commits into from
Feb 17, 2024

Conversation

mirek26
Copy link
Contributor

@mirek26 mirek26 commented Feb 11, 2024

Don't recreate the HMAC, just reset. That feature exists for a reason :) This makes postgres sasl auth 2-3ms faster (or 40ms in debug mode).

Benchmark results (with +nightly #![feature(test)] extern crate test;) on M1 Pro:

before:

test connection::sasl::bench_sasl_hi                                        ... bench:   4,004,666 ns/iter (+/- 73,042)

after

test connection::sasl::bench_sasl_hi                                        ... bench:   2,065,200 ns/iter (+/- 15,375)

@abonander abonander merged commit dd900e5 into launchbadge:main Feb 17, 2024
64 checks passed
kukabi pushed a commit to helikon-labs/sqlx that referenced this pull request Feb 22, 2024
* Optimize SASL auth in sqlx-postgres

* fix formatting
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