-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Fixed #36439 -- Optimized acheck_password by using sync_to_async on verify_password. #19611
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
Fixed #36439 -- Optimized acheck_password by using sync_to_async on verify_password. #19611
Conversation
3750296
to
1bb5279
Compare
acheck_password
CPU heavy internal hashing process by using a ThreadPoolExecutoracheck_password
CPU heavy internal hashing process by using a ThreadPoolExecutor
b984047
to
c9eec27
Compare
c9eec27
to
d1a1ef1
Compare
d1a1ef1
to
50a6d87
Compare
Based on the ticket, a test may not be needed for this patch. |
50a6d87
to
b5354b5
Compare
acheck_password
CPU heavy internal hashing process by using a ThreadPoolExecutoracheck_password
CPU heavy internal hashing process by using a ThreadPoolExecutor
b5354b5
to
c591c40
Compare
acheck_password
CPU heavy internal hashing process by using a ThreadPoolExecutoracheck_password
CPU heavy internal hashing process by using a sync
acheck_password
CPU heavy internal hashing process by using a syncacheck_password
CPU heavy internal hashing process by using a sync_to_async
on verify_password
.
Thank you @roelzkie15 👍
|
c591c40
to
ce3e0e7
Compare
I have created a PR on django-asv to add the benchmarks here: django/django-asv#94. Instructions are also included for other folks to test the benchmark. If something I need to improve on that benchmark PR, don't hesitate to let me know. 🙏🏼 |
…tion using different password hasher. This is related to django/django/pull/19611
ce3e0e7
to
f8a010f
Compare
f8a010f
to
beb9f80
Compare
acheck_password
CPU heavy internal hashing process by using a sync_to_async
on verify_password
.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.
Thank you for the PR to django-asv, I was able to replicate the performance improvement via the benchmarks 👍
beb9f80
to
570d20a
Compare
Trac ticket number
ticket-36439
Branch description
Conducted several experiments/benchmarks on the performance of theacheck_password
that blocks asyncio's event-loop, which is causing a performance bottleneck. Adding aThreadPoolExecutor
significantly improved the performance gap compared to the test without using it.Also, introduced theCHECK_PASSWORD_EXECUTOR_MAX_WORKERS
for allowing developers to provide a configurable setting for theThreadPoolExecutor
instance. See the updated document on this PR.EDIT:
Please check the new experiments/benchmarks on the performance of the
acheck_password
that blocks asyncio's event-loop, which is causing a performance bottleneck by using thesync_to_async
on theverify_password
.EDIT 2:
Added a new benchmark via django-asv here: django/django-asv#94
This PR targets a patch for v5.2 as mentioned in the ticket.
Checklist
main
branch.