Skip to content

performance: Appends to region_highlight are quadratic? #388

Open
@danielshahaf

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions