2
0
mirror of https://github.com/frappe/frappe.git synced 2024-06-13 06:22:23 +00:00

perf: num2words, babel, gettext, sentry imports (backport #26475) (#26476)

* perf: num2words, babel, gettext, sentry imports (#26475)

num2words - 260KB - Used frequently on ERPNext sites.
babel - 1.1MB Gets imported because of dates, localization
sentry - 2.8MB should be loaded only if envvar is set
gettext - required for reading translations

(cherry picked from commit 445e1dbd6b)

# Conflicts:
#	frappe/app.py
#	frappe/hooks.py
#	frappe/utils/sentry.py

* chore: conflicts

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
This commit is contained in:
mergify[bot] 2024-05-20 05:19:53 +00:00 committed by GitHub
parent 6bb35341b0
commit ea873fd8f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -48,7 +48,9 @@ class RequestContext:
# If gc.freeze is done then importing modules before forking allows us to share the memory
if frappe._tune_gc:
import babel.dates
import bleach
import num2words
import frappe.boot
import frappe.client