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

Drop support for v0 and v1 blocks #919

Merged
merged 22 commits into from
Sep 8, 2021

Conversation

joe-elliott
Copy link
Member

@joe-elliott joe-elliott commented Aug 30, 2021

What this PR does:
Drops support for v0 and v1 blocks and consolidates all code into v2.

TODO

  • Investigate Performance regression indicated by benchmarks
  • Figure out what to do with buffers

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
@joe-elliott joe-elliott marked this pull request as draft August 30, 2021 20:09
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
@joe-elliott
Copy link
Member Author

This is ready to go, but leaving draft status up b/c I want to merge #806 first. There will be some small conflicts.

@mdisibio mdisibio added this to the v1.2 milestone Aug 31, 2021
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
@joe-elliott joe-elliott marked this pull request as ready for review September 1, 2021 18:45
Copy link
Contributor

@annanay25 annanay25 left a comment

Choose a reason for hiding this comment

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

LGTM, just a minor non-blocking nit

if cap(pagesBuffer) < len(compressedPages) {
// extend pagesBuffer
diff := len(compressedPages) - cap(pagesBuffer)
pagesBuffer = append(pagesBuffer[:cap(pagesBuffer)], make([][]byte, diff)...)
Copy link
Contributor

Choose a reason for hiding this comment

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

append() will copy over all the items from old to new array right? and the resultant pagesBuffer array might have a cap larger than len(compressedPages), worth just creating a new array with cap(pagesBuffer) = len(compressedPages) ? The reuse is primarily useful when cap(pagesBuffer) > len(compressedPages) I guess

Copy link
Member Author

@joe-elliott joe-elliott Sep 8, 2021

Choose a reason for hiding this comment

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

and the resultant pagesBuffer array might have a cap larger than len(compressedPages)

I believe after this line len(pagesBuffer) = cap(pagesBuffer) = len(compressedPages)

worth just creating a new array with cap(pagesBuffer) = len(compressedPages)

by using whatever currently exists in pagesBuffer we reduce byte slice allocations. after this line the first N entries in pagesBuffer already have allocated byte slices that can be reused in ReadAllWIthBuffer. if we recreated the slice we would lose that.

@joe-elliott joe-elliott merged commit 7ef3168 into grafana:main Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants