-
Notifications
You must be signed in to change notification settings - Fork 131
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
Parallelize submission #24
base: master
Are you sure you want to change the base?
Conversation
If you have multiple different timers then this will speed up the processing time.
Fixed merge conflicts. Feel free to revisit. |
Thanks @JensRantil for this contributions. Can you share some benchmark deltas for this changeset? |
Feels like I made this pull request an eternity ago. Anyway, here are some benchmarks:
So, Oh, also, the tests seem to pass despite Travis failing this:
|
travis test failure was "index out of range" when indexing into position 0 of the slice func processTimer(buffer *bytes.Buffer, now int64, pctls Percentiles, u string, t Uint64Slice) {
sort.Sort(t)
min := t[0] Also, it failed while testing with go1.0.3 - is it possible that some difference between the version of go you use and go1.0.3 means |
I tried to recreate this. So far, nothing:
I am running Go 1.1 branch. Do you have a Go 1.0 installation at hand perhaps? Can you recreate this? |
defer wg.Done() | ||
numchan <- processTimers(&buffer, now, percentThreshold) | ||
}() | ||
wg.Done() |
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.
wg.Done() | |
wg.Wait() |
Make the flush operation execute in parallel.
These optimizations have been mentioned in #23.
Additional comments:
sync
package and only use channels. In this case, I thoughtsync.WaitGroup
felt like they were making the code more understandable. I might be wrong.