Opened 6 years ago

Closed 6 years ago

#27453 closed Cleanup/optimization (fixed)

LocaleRegexProvider unnecessarily recompiles the same regex for every active language

Reported by: Carl Meyer Owned by: nobody
Component: Core (URLs) Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

LocaleRegexProvider compiles every URL regex once per active language. This is in order to support lazily-translated URL patterns, but if the URL pattern is not translated, the extra compilations are useless work. For sites with many active languages, lots of traffic, and non-translated URLs, this can add up to noticeable extra CPU time.

Change History (5)

comment:1 Changed 6 years ago by Tim Graham

Has patch: set
Triage Stage: UnreviewedAccepted

comment:2 Changed 6 years ago by Marten Kenbeek

Patch needs improvement: set

I left a comment on the PR.

comment:3 Changed 6 years ago by Carl Meyer

Patch needs improvement: unset

PR updated, thanks for the review!

comment:4 Changed 6 years ago by Marten Kenbeek

Triage Stage: AcceptedReady for checkin

comment:5 Changed 6 years ago by Tim Graham

Resolution: fixed
Status: newclosed

In 6e222dae5636f875c19ec66f730a4241abe33faa:

Fixed #27453 -- Avoided unnecessary recompilation of non-translated URL regexes.

Note: See TracTickets for help on using tickets.
Back to Top