-
Notifications
You must be signed in to change notification settings - Fork 280
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
perf: WIP: Improve file transfer speed #1323
Conversation
|
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.
Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @anthonybilinski)
toxcore/net_crypto.c, line 997 at r1 (raw file):
const uint64_t temp_time = current_time_monotonic(mono_time); uint64_t l_sent_time = 0;
I think this variable can be removed completely, it seems to be never written and just used for comparison, which are then constant.
Testing these RTT changes more thoroughly and reproducibly, I don't think they improve transfer times. Building on them, I think another problem with RTT calculation is that a packets sent_time is reset when the packet is resent, but still used for RTT which can cause the following: which causes us to have an unreasonably short RTT of 51ms, and then think that all of our outstanding packets with a true RTT of ~500ms have been dropped because they haven't been delivered within 51ms. Using the original sent_time isn't necessarily valid either, since the packet may well have legitimately been dropped. Tracking when packets are resent and not using their sent_time for RTT calculation reduces the number of packets we think are dropped and improves overall transfer speed by about 2x in my testing, and traffic shape is a little less saw-tooth-y, but still not great. It looks like after this change, the target speed coming out of congestion control is still very volatile, with |
@anthonybilinski is toxcore actively measuring RTT? and can you tell me how? |
Codecov Report
@@ Coverage Diff @@
## master #1323 +/- ##
==========================================
+ Coverage 76.88% 77.15% +0.26%
==========================================
Files 105 105
Lines 17912 17580 -332
==========================================
- Hits 13772 13563 -209
+ Misses 4140 4017 -123
Continue to review full report at Codecov.
|
I did some further testing after having a couple people tell me this improved their transfer speeds significantly. Test Setup
Results
With this I can confidently say that the PR in the state it's in now is not a reliable fix, and could be related to the 3 disconnects during transfers that I saw. I think my last comment still needs to be looked into. ping @Monsterovich, I don't recommend including this in protox. |
@anthonybilinski can you write an auto_test for this? |
I'm using this patch on my PC for a few months (since toxcore 0.2.9). Without it the transfer speed in qTox is complete garbage. This patch keeps my transfer speed at 9-11 mb/s. In normal toxcore qTox reaches the highest speed and then it dramatically drops down to zero, then it starts to grow up again, repeat. On portable devices which use Wi-fi or LTE it's twice that bad. I'm going to make a separate version of Protox which includes this patch. I also recommend to merge this patch ASAP. My tests on protox (over Wi-fi): |
testing this with a specific client (be it qtox or any other) always includes client behaviour aswell. and then we can not be sure whats actually happening. we need to code a test for this, to test in a neutral environment. |
I have exactly the same behavior in qTox and Protox with or without this PR. I don't know what are you talking about. |
✔️ Deploy Preview for c-toxcore ready! 🔨 Explore the source changes: bd283a9 🔍 Inspect the deploy log: https://app.netlify.com/sites/c-toxcore/deploys/620089d032ca040007f294d6 😎 Browse the preview: https://deploy-preview-1323--c-toxcore.netlify.app |
* Don't only update connection RTT with shorter times - update with any new RTT * Don't use only default value for TCP, use connection RTT * Make lastest sent packet correctly measured
new RTT
This is a purely sender-side fix. Sending from qTox with this change through a slow VPN, then to a TCP relay, then through Tor to Antox on my phone I get about 200KiB/s consistently for a 100MB file. Before the change, I got speeds of about 4KiB/s on the same setup.
This change is![Reviewable](https://camo.githubusercontent.com/23b05f5fb48215c989e92cc44cf6512512d083132bd3daf689867c8d9d386888/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)