Backport from D8
$attrbutes
always has a space on when it calls Xss::attributes which leads to unnecessary calls to preg_match() and preg_replace().
Measurements
On the user permissions page with 11 roles:
Function Name | Calls Diff | Calls Diff% | Incl. Wall Diff (microsec) | IWall Diff% | Excl. Wall Diff (microsec) | EWall Diff% | Incl. MemUse Diff (bytes) | IMemUse Diff% | Excl. MemUse Diff (bytes) | EMemUse Diff% | Incl. PeakMemUse Diff (bytes) | IPeakMemUse Diff% | Excl. PeakMemUse Diff (bytes) | EPeakMemUse Diff% |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
trim | 751 | 51.9% | -10 | -0.0% | -10 | -0.0% | 30,624 | 2036.2% | 30,624 | 2036.2% | 0 | 0.0% | 0 | 0.0% |
strlen | -733 | -50.6% | -15 | -0.0% | -15 | -0.0% | -16 | -1.1% | -16 | -1.1% | 0 | 0.0% | 0 | 0.0% |
preg_match | -733 | -50.6% | -695 | -0.7% | -695 | -0.7% | -256 | -17.0% | -256 | -17.0% | -1,640 | -101.5% | -1,640 | -101.5% |
preg_replace | -733 | -50.6% | -3,201 | -3.4% | -3,201 | -3.4% | -113,632 | -7555.3% | -113,632 | -7555.3% | -1,472 | -91.1% | -1,472 | -91.1% |