[wp-hackers] l10n object bloat and class PO

Nikolay Bachiyski nb at nikolay.bg
Mon Oct 19 09:15:36 UTC 2009

On Thu, Oct 15, 2009 at 17:45, Johan Eenfeldt <johan.eenfeldt at gmail.com> wrote:
> Somewhat specialized questions, here...
> Working on caching the $l10n object (responsible for 20-75% of
> localized WordPress startup time) I've been banging my head a bit
> against the wp-include/pomo/ classes.
> $l10n is 3.3Mb out of the ~14Mb startup WP allocations in my test. At
> least 750Kb of that appears to be totally unused.
> Question 1: is class PO [1] (wp-includes/pomo/po.php) ever used?
> I'm guessing it might possibly be in the WP.com admin generate plugin
> pot stuff, but there doesn't seem to be anything in WordPress.

Yes, whenever you are using translated version of WordPress, it is.

> Question 2: is there any reason not to remove (or split out) the
> members of class Translation_Entry which are only used by PO (and not
> MO)?

I am working on improving the PO/MO classes for both speed and memory
and I will have some actual results, soon. When I wrote the code my
initial tests didn't show that much of a difference as the real-world
usage did.

Happy hacking,

More information about the wp-hackers mailing list