Conversation
|
Apologies for the large change, especially in the first commit, but I didn't see a great way to incrementally remove the C packet. |
aacaedf to
fe00bfb
Compare
|
I was worried that adding an
We do see a runtime slowdown effect due to the additional atomic operations as expected. I'm not sure how bad of a performance hit this is. If we think it's bad, we could consider using |
I'm not sure I'm convinced that the slowdown is caused by https://github.com/shadow/benchmark-results/tree/master/tor/2025-01-14-T18-06-33 If it is the |
|
OK, thanks for checking into that! There's probably something else we could be doing better in the code then, which is good news :) |
There was a problem hiding this comment.
The changes look good to me! I'm not sure what's causing the performance difference though. We are doing more allocations and more packet refs/unrefs, so maybe it is one of those. I'll leave it up to you whether you want to merge with the performance as-is. If we do, I think this should also be mentioned in the changelog. I'll also take another look at the performance, but I'm not sure how best to debug other than just trying to reduce the number of allocations and packet refs/unrefs, and then seeing if that fixes it. Shadow does seem to be behaving the same though, so it seems like only a change in performance and not behaviour.
|
Removing the object counter from Full Tor benchmark results: |
Nice find! I'm surprised that the object counter was the problem. I think it's just an extra hash table lookup each time a packet is created/destroyed? I guess there's a lot of packets, but the hash table accesses seem small compared to everything else we do with packets (allocating memory, copying payload data, etc). |
The Rust packet provides a C API in support of the legacy TCP stack.
56ed3bc to
3b938ce
Compare





Eliminates usage of the C packet and payload structs. This allows us to track application payloads using
Bytesobjects in Rust, which should make Rust code such as the Rust TCP stack and UDP payload handling more efficient.