#36439: Auth hashing blocks event loop if using asyncio
-------------------------------------+-------------------------------------
     Reporter:  Robert Aistleitner   |                    Owner:  Roelzkie
         Type:                       |                   Status:  assigned
  Cleanup/optimization               |
    Component:  contrib.auth         |                  Version:  5.2
     Severity:  Normal               |               Resolution:
     Keywords:  async, auth,         |             Triage Stage:  Accepted
  asyncio, performance               |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Comment (by Roelzkie):

 I made a new benchmarking with the latest `main`. The result is very
 different from my previous testing, and I'm not so sure if it's due to the
 rebase from recent `main` or due to some changes in my local setup.

 These tests were conducted on 100 users with a SQLite database, and the
 results of using `sync_to_async` with or without `ThreadPoolExecutor`
 showed no significant difference. However, it's 5x faster than the current
 version. For Argon2, the performance shows almost no difference, at least
 for the SQLite database.

 {{{#!table
 ||        ||= PBKDF2PasswordHasher =||= PBKDF2SHA1PasswordHasher =||=
 Argon2PasswordHasher =||= BCryptSHA256PasswordHasher =||=
 ScryptPasswordHasher =||
 ||=Current =||  14.103s  ||  15.578s  ||  0.005s  ||  23.487s  ||  16.11s
 ||
 ||=With `sync_to_async` =||  3.124s  ||  2.957s  ||  0.004s  ||  3.867s
 ||  3.335s  ||
 ||=With `sync_to_async` and `ThreadPoolExecutor` =||  2.775s  ||  2.855s
 ||  0.004s  ||  3.804s  ||  3.661s  ||
 }}}
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36439#comment:13>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019822cc6796-15021aae-a379-4a56-bbe8-a0b68979da82-000000%40eu-central-1.amazonses.com.

Reply via email to