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
Ineffective breaks in heap_manager.go #128
Comments
Yep, staticcheck's suggestion is right, despite current behavior doesn't lead to any bugs.
Thankfully I left a comment
It's used to feed |
I meant the Benchmark results:
Also, avoiding the pool is also going to less code and easier to reason about. While reviewing the code, I realized that that it's always putting back the small slice, so there's no problem with holding on to a potentially large slices. |
Addressed in v8.4.0. |
I was looking through the codebase and when running staticcheck it lists these issues:
mpb/heap_manager.go
Line 80 in d8400e9
mpb/heap_manager.go
Line 90 in d8400e9
I'm not sure whether you want to return or just exit the bHeap handling.
Other things I noticed that aren't errors per se, but looked unusual to me:
mpb/decor/eta.go
Line 203 in d8400e9
time.Duration has Truncate func: https://pkg.go.dev/time#Duration.Truncate
https://github.com/vbauerster/mpb/blob/d8400e981502dafd3884e25d826a01ae659a74c2/decor/pool.go
using a
var buffer [64]byte
should get you most of the way and avoid scenarios where you accidentally pool large[]byte
values for a long time.The text was updated successfully, but these errors were encountered: