#30899: Lazily compile large regular expressions
-------------------------------------------------+------------------------
Reporter: Adam (Chainz) Johnson | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Other) | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------------+------------------------
Inspired by [this article from Instagram](https://instagram-
engineering.com/python-at-scale-strict-modules-c0bb9245c834)
Currently Django lazily compiles some regular expressions such as those in
validators:
https://github.com/django/django/blob/54ea290e5bbd19d87bd8dba807738eeeaf01a362/django/core/validators.py#L17
This is to save on import time.
There are other import-time `re.compile` calls throughout the codebase,
these could be migrated to lazy regex compiles to save on their import
time:
https://github.com/django/django/search?q=re.compile&unscoped_q=re.compile
--
Ticket URL: <https://code.djangoproject.com/ticket/30899>
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 on the web visit
https://groups.google.com/d/msgid/django-updates/053.bf110d6abc1af114ae1c9e3b503060f2%40djangoproject.com.