Skip to content

Cache private email regex for a request

Robert May requested to merge private-email-regex-performance-fix into master

What does this MR do and why?

When loading large amounts of avatars, such as on a busy blame file, we spend a lot of time regenerating the same static regex for every commit email we try to match. This introduces a request cache wrapper to ensure it's only calculated once per request. This is only stored in memory and so will change on each request, but will prevent it using a surprising amount of resources on a single request.

Changelog: performance

Related #220950

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshot_2024-02-13_at_16.57.59

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Merge request reports