Skip to content

array optimizations for sort/unique #517

@pkoppstein

Description

@pkoppstein

In order to avoid unnecessary calls to unique and sort, it would be a very useful
enhancement if two bits could be added to the array struct (jvp_array), to record whether or not
it is known if (a) (a|sort) is a no-op, and (b) (a|unique) is a no-op.

The main reasons for this request are:

  1. to allow set-oriented operations to be implemented efficiently using arrays as a backing; and
  2. to support binary search through arrays if they are known to be sorted.

Optimizing the use of these bits may be difficult, but in my view that should not be a reason not to introduce them with at least minimal support.

Thanks!

Metadata

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