Skip to content
This repository was archived by the owner on Aug 13, 2019. It is now read-only.

Re-use 'keys' in ReadOffsetTable - #645

Merged
codesome merged 2 commits into
prometheus-junkyard:masterfrom
codesome:reuse-keys
Jul 9, 2019
Merged

codesome merged 2 commits into
prometheus-junkyard:masterfrom
codesome:reuse-keys

Conversation

@codesome

@codesome codesome commented Jul 2, 2019 •

Copy link
Copy Markdown
Contributor

This is a broken down piece of #627

This saves a whole bunch of allocs when opening a block.

  • Add comment for why the len of keys is set to 2

Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
Comment thread index/index.go
d := encoding.NewDecbufAt(bs, int(off), castagnoliTable)
cnt := d.Be32()

keys := make([]string, 0, 2)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

#627 (comment) tells why I have set the size to 2.

@bwplotka

bwplotka commented Jul 2, 2019

Copy link
Copy Markdown
Contributor

I love PR splitting - so much easier to review ❤️ @tomwilkie :trollface:

@bwplotka bwplotka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ship it!

shipit

Thanks for splitting this work into nice pieces 👍

Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
@codesome
codesome merged commit 8dfa537 into prometheus-junkyard:master Jul 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants