Skip to content

Calling addItems naïvely causes frequent resizes. #121

@psobot

Description

@psobot

This is more of a TODO than an issue, but calling addItems on a small index will force us to resize the index implicitly to fit the additional rows. This is convenient, but calling addItems over and over again causes frequent resizes, which are extremely slow and "block the world."

Instead, we should consider doing one of the following options when addItems will push us over the limit:

  • Resize the index by a certain percentage (i.e.: add 10%) instead of just trying to fit the new elements
  • Throw an exception if the index is too small, forcing the caller to manually call resize
  • Make both of the above options possible by adding a resize_policy attribute to Index and choosing its default value based on the index size or other properties

cc @dylanrb123

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions