Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(skiplist): Add sorted skiplist builder #1693

Merged
merged 6 commits into from
Apr 21, 2021

Conversation

ahsanbarkati
Copy link
Contributor

@ahsanbarkati ahsanbarkati commented Apr 21, 2021

Add a Builder type in skiplist package which can be used to insert
sorted keys efficiently.


This change is Reviewable

Copy link
Contributor

@manishrjain manishrjain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 3 of 3 files at r2.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @ahsanbarkati)


skl/skl.go, line 550 at r2 (raw file):

	if debug {
		if len(b.prevKey) > 0 && y.CompareKeys(k, b.prevKey) <= 0 {
			panic(fmt.Sprintf("new key: %s <= prev key: %s\n", y.ParseKey(k), y.ParseKey(b.prevKey)))

overflow


skl/skl.go, line 563 at r2 (raw file):

	for i := 0; i < height; i++ {
		node := b.prev[i]
		node.tower[i] = s.arena.getNodeOffset(x)

can move this outside.

@ahsanbarkati ahsanbarkati merged commit 59c56ee into master Apr 21, 2021
@ahsanbarkati ahsanbarkati deleted the ahsan/sorted-skl-builder branch April 21, 2021 18:50
fredcarle pushed a commit to fredcarle/badger that referenced this pull request Aug 1, 2023
Add a Builder type in skiplist package which can be used to insert
sorted keys efficiently. Add a test and benchmark for it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants