t() issued one SELECT per translated field (1,300+ queries on a typical multilanguage home). It now preloads all translations of a (table, record, language) in a single query and serves subsequent fields from memory, preserving the previous LIMIT 1 semantics (first row per fieldName). Measured on villagrancanaria: cold render -60% (en home) / -67% (es home), byte-identical output. REQUIRES index (tableName, recordNum, prefix) on cms_traducciones — without it the batched query scans and is SLOWER than before: ALTER TABLE cms_traducciones ADD INDEX idx_tabla_registro_prefijo (tableName, recordNum, prefix);
35 KiB
Executable File
35 KiB
Executable File