#111000Reduce allocations in implodeAttributes
Description
Render XHTML attribute fragments during normalization instead of
collecting escaped values and rendering them in a second loop. Return
early for an empty attribute array and avoid escaping blank values that
will be omitted. Preserve escaping, attribute order and duplicate
handling.
Microbenchmarks on PHP 8.5 show 4-11% less time and 38-56% fewer
temporary allocations for six attributes. With 100 attributes,
temporary allocations drop by 34%, with a 2.5-3.4% time increase when
blank attributes are omitted.
Reviews 1
History 13
-
Gerrit Code Review pushed patch set 2 for main to change 96373 status
NewUnder Review <span data-processor="relativetime" data-value="2026-10-09T18:16:34+00:00" > 10/09/26, 18:16 </span> -
Gerrit Code Review pushed patch set 3 for main to change 96373 <span data-processor="relativetime" data-value="2026-10-09T18:16:38+00:00" > 10/09/26, 18:16 </span>
-
Wouter Wolters commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-11-09T20:25:11+00:00" > 11/09/26, 20:25 </span>
Applied in changeset commit:0a015b50b42abae77d2f1eb4769e25c104059a14.