-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Use iterators for in-process Series calls #7796
Conversation
ea5fe01
to
3dc7b18
Compare
The TSDBStore has two implementations of Series. One uses a goroutine and the other one buffers series in memory. Both are used for different use cases and trade-off CPU and memory according to the use. In order to reconcile these two approaches, we can use an iterator which relies on coroutines that have a much lower overhead than goroutines. Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
5c463da
to
6e07c71
Compare
go 1.22.0 | ||
|
||
toolchain go1.22.5 | ||
go 1.23.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we maybe bundle this on a separate PR? This interferes with build, maybe we should bump to 1.23 all in one pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically we don't need to bump the version in go.mod
because that indicates the minimum required version. If we do a bump without using new features, it means that downstream users are also forced to update their version even though there's no reason for that.
The goroutine leak seems to be legit, let me take a deeper look. |
6e07c71
to
2958a8c
Compare
Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
2958a8c
to
1eaf6b0
Compare
The build and all tests should be passing now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Doc failure is u related |
* Use iterators for in-process Series calls The TSDBStore has two implementations of Series. One uses a goroutine and the other one buffers series in memory. Both are used for different use cases and trade-off CPU and memory according to the use. In order to reconcile these two approaches, we can use an iterator which relies on coroutines that have a much lower overhead than goroutines. Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com> * Update golangci-lint Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com> * Fix lint Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com> --------- Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
The TSDBStore has two implementations of Series. One uses a goroutine and the other one buffers series in memory. Both are used for different use cases and trade-off CPU and memory according to the use.
In order to reconcile these two approaches, we can use an iterator which relies on coroutines that have a much lower overhead than goroutines.
Changes
Verification