-
Notifications
You must be signed in to change notification settings - Fork 59
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
Implement single connection benchmark #308
Implement single connection benchmark #308
Conversation
Adding this as a draft, because I wanted to make sure this part looks like intended in the issue, before pushing the rest. |
704bb86
to
6af5165
Compare
@dkropachev could you take a look? |
6af5165
to
c43e2e2
Compare
@dkropachev I pushed some changes, it is clearly wip, but I want to make sure the direction is right |
c43e2e2
to
896c9d8
Compare
896c9d8
to
2d48701
Compare
30e27dc
to
45191a1
Compare
@dkropachev I pushed some changes, it is still not a complete solution, I am not sure how to replay the traffic properly, but it is in such a state that it should be possible to state if the direction is good |
f75b620
to
bf816cd
Compare
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.
Probably you could reuse something from TestServer
from conn_test.go
to replay traffic
bf816cd
to
4f62762
Compare
4f62762
to
f916796
Compare
f916796
to
dd128d8
Compare
dd128d8
to
5604eb6
Compare
@sylwiaszunejko , we need to disable these guys for
|
5604eb6
to
5c42e6b
Compare
5c42e6b
to
f6655e7
Compare
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.
Final change I it is finally ready, great job, it produces pretty stable results:
cpu: 12th Gen Intel(R) Core(TM) i9-12900HK
BenchmarkSingleConnectionInsert
BenchmarkSingleConnectionInsert/Insert
BenchmarkSingleConnectionInsert/Insert/Case0
BenchmarkSingleConnectionInsert/Insert/Case0-20 242354 4332 ns/op
BenchmarkSingleConnectionInsert/Insert/Case1
BenchmarkSingleConnectionInsert/Insert/Case1-20 295485 4334 ns/op
BenchmarkSingleConnectionInsert/Insert/Case2
BenchmarkSingleConnectionInsert/Insert/Case2-20 304800 4332 ns/op
BenchmarkSingleConnectionInsert/Insert/Case3
BenchmarkSingleConnectionInsert/Insert/Case3-20 266346 4240 ns/op
BenchmarkSingleConnectionInsert/Insert/Case4
BenchmarkSingleConnectionInsert/Insert/Case4-20 254448 4042 ns/op
BenchmarkSingleConnectionInsert/Insert/Case5
BenchmarkSingleConnectionInsert/Insert/Case5-20 288975 4270 ns/op
BenchmarkSingleConnectionInsert/Insert/Case6
BenchmarkSingleConnectionInsert/Insert/Case6-20 279169 4152 ns/op
BenchmarkSingleConnectionInsert/Insert/Case7
BenchmarkSingleConnectionInsert/Insert/Case7-20 294770 4074 ns/op
BenchmarkSingleConnectionInsert/Insert/Case8
BenchmarkSingleConnectionInsert/Insert/Case8-20 299186 3994 ns/op
BenchmarkSingleConnectionInsert/Insert/Case9
BenchmarkSingleConnectionInsert/Insert/Case9-20 305224 4147 ns/op
PASS
Add new types of dialers, one for recording one for replaying the traffic. Record example traffic and then use it to benchmark frame serialization and deserialization without using real net.Conn.
f6655e7
to
e5df002
Compare
@sylwiaszunejko , I spot another problem, standard benchrmark library does not collect |
I agree |
I created an issue to collect goroutine stats #330 |
API for hooking to
Write()
andRead()
ofConn
struct added. New structTrafficRecorder
added for enabling recording and mocking single Connection flow.Fixes: #296