Opened 8 years ago

Closed 8 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 by Tim Graham, 8 years ago

Has patch: set
Triage Stage: UnreviewedAccepted

comment:2 by Marten Kenbeek, 8 years ago

Patch needs improvement: set

I left a comment on the PR.

comment:3 by Carl Meyer, 8 years ago

Patch needs improvement: unset

PR updated, thanks for the review!

comment:4 by Marten Kenbeek, 8 years ago

Triage Stage: AcceptedReady for checkin

comment:5 by Tim Graham, 8 years ago

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