WordPress.org

Make WordPress Core

Opened 21 months ago

Last modified 9 months ago

#43096 new enhancement

Reduce redundant calls to translate()

Reported by: superdav42 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: I18N Keywords:
Focuses: performance Cc:
PR Number:

Description

Profiling the default WordPress install I noticed translate functions where being called 1700+ times and many times with duplicate strings. This patch uses static vars in a few key places to avoid translating the same string multiple times. Gives about a 14% reduction in page response time and a very slight memory increase. See https://blackfire.io/profiles/compare/6b2513f0-de36-400d-9e39-2349644b3d57/graph

Attachments (1)

43096.diff (20.5 KB) - added by superdav42 21 months ago.
patch

Download all attachments as: .zip

Change History (3)

@superdav42
21 months ago

patch

#2 @pento
9 months ago

  • Version trunk deleted
Note: See TracTickets for help on using tickets.