-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
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 quantitativelyIf needed, switch from appending directly to using a temporary arrayTo pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
danielshahaf commentedon Nov 8, 2016
workers/39869 might be related.
danielshahaf commentedon Nov 26, 2017
Note that array appends are quadratic too, independently of region_highlight's setter. Possibly with a smaller big-O constant.