onflow / onflow/atree

SAT: Optimize rebalancing algorithm

Open
#18 0 comments 0 reactions 1 assignee View on GitHub

@fxamacker is already working on this.

Since Sep 24, 2021.

Dominant language
Go
Stars
43
Forks
20
PR merge metrics
No merged PRs in 30d

Description

The rebalancing algorithm can be optimized for speed and to reduce number of slabs accessed/loaded.

  • Check right sibling first (instead of left sibling) to see if it has enough data to lend
  • Check left sibling only if (instead of always) the right sibling doesn't have enough data to lend. The benefit from borrowing from the larger sibling was maybe not worth the extra effort of accessing 2 slabs.
  • Move data within the right sibling's underlying array after it lends so it has capacity for future ops

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.