-
Notifications
You must be signed in to change notification settings - Fork 9
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
Don't use cstruct - use string/bytes! #223
Conversation
Co-authored-by: Hannes Mehnert <[email protected]> Co-authored-by: Reynir Björnsson <[email protected]>
With this branch and no-cstruct opam repository I see a significant speedup: cc628d5 (this branch + bench marking): fe92b0a (main): There is as well a higher number of reported allocations. It is unclear how much this is due to cstructs being underreported and how much it is an increase in allocations. |
After @hannesm fixed the bug in ocaml-tls#no-cstruct that caused invalid MAC I can now test against a VM on my machine running OpenVPN.?? and iperf3: Main branch
This branch & no-cstruct repo (with TLS fix)
There is a performance improvement in sending (upload) and a performance regression in receiving (download). I think this is promising as the cstruct->string change in Miragevpn was somewhat naïve and there is room for some low-hanging improvements. It is also interesting to me the asymmetry goes from 1:2 to 2:3 in upload/download speeds. Note: the numbers are collected on a different machine than in #206 so they are unfortunately not comparable. If desired I can measure on that machine (which will require compiling for a different debian release). |
When decoding operation return offset and length of the package. We avoid copying the packet only to copy it again without the first byte.
I pushed some commits that reduce the number of allocations and copying and I can observe a small improvement in the bechamel benchmark. I was struggling to observe improvements in the openvpn/iperf3 VM benchmark, and so I tried running the openvpn/iperf3 benchmark against
|
For comparison here is 4 runs of iperf3 with this branch:
|
Unfortunately, appending the empty string to another string results in a potentially expensive copy.
I discovered that This is a flamegraph before that commit. As you can see in Here is the flamegraph with that commit. The So it seems for TCP, when running iperf3 load at least, we often have lingering bytes, Maybe it is worth looking into a better suited data structure then. |
Oops I inadvertently pushed the octets commit |
Superceded by #279 |
No description provided.