-
Notifications
You must be signed in to change notification settings - Fork 319
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
Add benchmark test case for TURN/UDP profiling #298
Conversation
Overall, it seems pion/turn is doing fairly well in the benchmarks: judging from the flame graph (click View/Flame-graph in the GUI), roughly 65% of the running time is spent in I/O ( One minor outlier is Apart from this, however, pion/turn seems to be doing nicely and there do not seem to be major low-hanging optimization targets. |
I think we should modernize the code and use the |
Codecov ReportBase: 68.44% // Head: 68.92% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #298 +/- ##
==========================================
+ Coverage 68.44% 68.92% +0.48%
==========================================
Files 38 38
Lines 2475 2475
==========================================
+ Hits 1694 1706 +12
+ Misses 644 636 -8
+ Partials 137 133 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
Thanks :) Looks good to me!
I only have made a couple of small code-style fixes:
err.Error()
should not be necessary to print the error. Just useerr
. The%s
format will callString()
implicity on the error- Error messages usually start with "Failed to ..."
- Both comments and log messages (excluding errors created by
fmt.Errorf()
) should start with a capital letter.
My changes are here abbc38b
Could you apply them to your branch, so we can merge them via this PR?
Unfortunately, I dont have the permission to push to your branch myself directly.
And, I fixed some of the linter warnings which you silcenced via |
A new benchmark test is added that allows to stress the TURN/UDP client and the server in a simple setup. This allows to get an insight into the running times of the main TURN/UDP client-server routines with real I/O. Usage: - run: `go test -cpuprofile cpu.prof -bench=. -run=XXX -benchtime=10s` - view profile: `go tool pprof -http=":8001" ./cpu.prof &`
Minor code-style fixes for new server benchmark
abbc38b
to
6715d4a
Compare
Thanks! I wish you didn't have to do all the extra work with my PRs, I'll try to stick the coding style. As per
Now I see that
And then, can we also use the
My understanding is that this all would be OK, but I've never used And if this is all OK, are you willing to take a PR that makes this change? Is it OK to add a new package dependency? |
Please do not worry about that. I am really happy to have the chance to do this review work. |
A new benchmark test is added that allows to stress the TURN/UDP client and the server in a simple setup. This allows to get an insight into the running times of the main TURN/UDP client-server routines with real I/O.
Usage:
go test -cpuprofile cpu.prof -bench=. -run=XXX -benchtime=10s
go tool pprof -http=":8001" ./cpu.prof &