Skip to content
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

How often to poll WuUpdate #12

Closed
seeme-o opened this issue Jun 18, 2019 · 2 comments
Closed

How often to poll WuUpdate #12

seeme-o opened this issue Jun 18, 2019 · 2 comments

Comments

@seeme-o
Copy link

seeme-o commented Jun 18, 2019

I am adapting WuNetwork.cpp to work using coroutines and I am currently calling WuUpdate via a timer. I am using 1ms intervals but haven't done enough testing to know if this is overkill, or even worse if it may cause issues when handling connection heartbeats. Do you have any input regarding a healthy/optimal interval for updating clients? Thanks

@seemk
Copy link
Owner

seemk commented Jun 20, 2019

I think it depends on the maximum latency you're willing to accept when polling for new data. Currently WebUDP is sending SCTP heartbeats with 4 second intervals. If you're using it in a game, once per frame should be good I guess.

@seeme-o
Copy link
Author

seeme-o commented Jun 24, 2019

Did a few tests, and here's what I came up with:

3 test runs with 1ms second intervals and 3 test runs with 10ms. They show an increase of min time using the greater interval running roundtrip_histogram.html

test 1, 10ms interval
roundtrip_histogram.html:84 max=34.34 ms
roundtrip_histogram.html:85 min=0.59 ms
roundtrip_histogram.html:86 completed=100%

test 2, 10ms interval
roundtrip_histogram.html:84 max=34.17 ms
roundtrip_histogram.html:85 min=0.54 ms
roundtrip_histogram.html:86 completed=100%

test 3, 10ms interval
roundtrip_histogram.html:84 max=39.05 ms
roundtrip_histogram.html:85 min=0.60 ms
roundtrip_histogram.html:86 completed=100%

test 1, 1ms interval
roundtrip_histogram.html:84 max=37.21 ms
roundtrip_histogram.html:85 min=0.33 ms
roundtrip_histogram.html:86 completed=100%

test 2, 1ms interval
roundtrip_histogram.html:84 max=32.77 ms
roundtrip_histogram.html:85 min=0.38 ms
roundtrip_histogram.html:86 completed=100%

test 3, 1ms interval
roundtrip_histogram.html:84 max=44.98 ms
roundtrip_histogram.html:85 min=0.34 ms
roundtrip_histogram.html:86 completed=100%

One interesting note is that is showed a noticeable performance improvement over the regular EchoServer

EchoServer
roundtrip_histogram.html:84 max=185.61 ms
roundtrip_histogram.html:85 min=0.34 ms
roundtrip_histogram.html:86 completed=89.64999999999999%

roundtrip_histogram.html:84 max=141.45 ms
roundtrip_histogram.html:85 min=0.36 ms
roundtrip_histogram.html:86 completed=82.45%

roundtrip_histogram.html:84 max=238.99 ms
roundtrip_histogram.html:85 min=1.36 ms
roundtrip_histogram.html:86 completed=47.55%

@seeme-o seeme-o closed this as completed Jun 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants