#36190: High memory usage of CommonPasswordValidator
-------------------------------------+-------------------------------------
Reporter: Michel Le Bihan | Owner: Priyanshu
Type: | Singh Panda
Cleanup/optimization | Status: closed
Component: contrib.auth | Version: 5.1
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
CommonPasswordValidator | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Priyanshu Singh Panda):
Replying to [comment:3 Sarah Boyce]:
> Michel can you please share steps to reproduce? This will help in
investigating and resolving any issues
I was able to generate this using the "piotrcki-wordlist-top10m.txt" file,
which contains around 10 million commonly used passwords. The
CommonPasswordValidator loads the file and stores the passwords in a list.
By default, the original file contains only 2,000 passwords, which is much
smaller compared to the new file and requires more memory.
{{{
try:
with gzip.open(password_list_path, "rt", encoding="utf-8") as f:
self.passwords = {x.strip() for x in f}
except OSError:
with open(password_list_path) as f:
self.passwords = {x.strip() for x in f
}}}
I'm currently working on addressing the memory issue caused by loading
such a large file. Please assign this task to me so I can continue working
on optimizing it.
--
Ticket URL: <https://code.djangoproject.com/ticket/36190#comment:4>
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/01070195180bf9a6-29a1d6f2-cd89-4dc9-a7b1-d40c65600899-000000%40eu-central-1.amazonses.com.