Skip to content

Commit

Permalink
perf: num2words, babel, gettext, sentry imports (backport #26475) (#2…
Browse files Browse the repository at this point in the history
…6476)

* 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 445e1db)

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

* chore: conflicts

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
  • Loading branch information
mergify[bot] and ankush committed May 20, 2024
1 parent 6bb3534 commit ea873fd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frappe/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ def __exit__(self, type, value, traceback):

# 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
Expand Down

0 comments on commit ea873fd

Please sign in to comment.