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

Improve startup time of inmem index #9488

Merged
merged 1 commit into from
Feb 27, 2018
Merged

Improve startup time of inmem index #9488

merged 1 commit into from
Feb 27, 2018

Conversation

e-dard
Copy link
Contributor

@e-dard e-dard commented Feb 27, 2018

This PR improves the startup time when using the inmem index by
ensuring that the series are created in the index and series file in
batches of 10000, rather than individually.

Fixes #9486.

Using the same dataset as #9486 with 4M series:

release startup time
1.3.9 27s
1.4.2 27s
1.5.0rc3 91s
PR 20s

So that's an improvement of ~25% on 1.3.9. However @jwilder @stuartcarnie I'm not set on this PR yet as we may not be able to re-use the keys buffer as I'm currently doing. I'm going to dig around a bit and see if it needs to be changed to allocate a new [][]byte for each batch rather than re-using the same one.

This commit improves the startup time when using the `inmem` index by
ensuring that the series are created in the index and series file in
batches of 10000, rather than individually.

Fixes #9486.
@ghost ghost assigned e-dard Feb 27, 2018
@ghost ghost added the review label Feb 27, 2018
@e-dard e-dard added this to the 1.5.0 milestone Feb 27, 2018
@e-dard
Copy link
Contributor Author

e-dard commented Feb 27, 2018

Not re-using the buffers doesn't make any real difference to the startup time, it just means more garbage.

Copy link
Contributor

@stuartcarnie stuartcarnie left a comment

Choose a reason for hiding this comment

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

LGTM 🥃

@e-dard e-dard changed the title Improve startup time of inmem index Improve startup time of inmem index Feb 27, 2018
@e-dard e-dard merged commit 863fe59 into master Feb 27, 2018
@ghost ghost removed the review label Feb 27, 2018
@e-dard e-dard deleted the er-inmem-startup branch February 27, 2018 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants