Open
Description
@psprint reports that appending to $region_highlight
is faster if first accumulating to another array and then appending to $region_highlight
in one shot, compared to appending to $region_highlight
directly.
Speculation: this may be because the $region_highlight
is a special array (in the ${(t)foo}
sense), and because the array's setfn is called on the entire array each time, not only on the appended portion.
- Investigate the difference quantitatively
- If needed, switch from appending directly to using a temporary array
Activity