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

 More benchmark tests for different hashers with 100 users:

 **PBKDF2PasswordHasher 100 users**
 - Current: **25.555 seconds**
 - With sync_to_async: **25.340 seconds**
 - With ThreadPoolExecutor(8): **7.141 seconds**

 **PBKDF2SHA1PasswordHasher 100 users**
 - Current: **26.066 seconds**
 - With sync_to_async: **25.890 seconds**
 - With ThreadPoolExecutor(8): **7.436 seconds**

 **Argon2PasswordHasher 100 users**
 - Current: **3.568 seconds**
 - With sync_to_async: **3.469 seconds**
 - With ThreadPoolExecutor(8): **2.683 seconds**

 **BCryptSHA256PasswordHasher 100 users**
 - Current: **23.532 seconds**
 - With sync_to_async: **23.347 seconds**
 - With ThreadPoolExecutor(8): **6.435 seconds**

 **ScryptPasswordHasher 100 users**
 - Current: **16.721 seconds**
 - With sync_to_async: **16.282 seconds**
 - With ThreadPoolExecutor(8): **4.782 seconds**

 Certainly, having a `ThreadPoolExecutor` has a wide performance gap
 compared to others without it, as theorized by Robert. I'm happy to
 provide a patch for this if you'll allow me. Not sure if we need to create
 a test for this but let me know.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36439#comment:8>
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/01070197c1184dd8-89b43186-8c53-40d4-ab22-ec96e194d223-000000%40eu-central-1.amazonses.com.

Reply via email to