﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30899	Lazily compile regular expressions.	Adam Johnson	Hasan Ramezani	"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"	Cleanup/optimization	closed	Core (Other)	dev	Normal	fixed		me@…	Ready for checkin	1	0	0	0	0	0
