How to profile a Rust binary?
⚓ Rust 📅 2025-11-18 👤 surdeus 👁️ 3Hi
In this issue we are discussing if we should reduce the buffer limit for Rustls streams from the default 64kb to 16kb.
I am using Apple Instruments to profile if there actually is a performance improvement when reducing it to 16kb. I have used Blackfire to profile PHP projects before, but I am not sure how to analyze these profiling runs for Rust projects.
What I did was a cargo build --release multiple times for both a buffer of 64kb and 16kb. Then I did multiple runs in Apple Instruments.
For e.g Allocations:
For both 16kb and 64kb I had similar amount of total bytes.
Also the total execution time did not really show any significant difference between the two options:
The Network Connection data sadly is always empty, in a few runs it shows data for other processes totally not related to the binary I'm profiling:
So I am wondering how I would actually profile a Rust binary?
- The difference between 64kb and 16kb probably would be subtle, but how to even detect subtle performance improvements?
- Each run has different numbers effected by many external factors, how to still derive conclusions despite this?
- Other tips on how to profile a Rust binary?
1 post - 1 participant
🏷️ Rust_feed


