Stack placement, not timers, caused a 55% benchmark slowdown in tellus
The team behind tellus, an actor framework for Rust, found that adding timers made a benchmark 55% slower, but the timers were not the cause. Removing the timer code still left the benchmark 55% slower, and adding one unused 16-byte field cut the gap to 7 or 8%. Aligning functions to 64 bytes with LLVM[1] flags showed that code placement was not the cause either, but that stack temporaries mattered.
To test the stack alone, they loaded a small C library through LD_PRELOAD[2] that shifts each thread's stack by a set number of bytes without changing the binary. On queued with four senders pinned to one CPU, the same binary took 3.49 ms at shift 0 and 5.83 ms at shift 96, which is 67% slower, and the slowdown repeated every 4096 bytes, the size of a memory page. The cause was a 16-byte load in Mailbox::recv that crossed a page boundary because the Incoming type has alignment 1. Patching only that temporary cut the time from 6.78 to 4.73 ms.
Aligning ActorId to 16 bytes removed the slow shifts, but it almost doubled the memory of a mailbox full of empty messages and cost up to 21% on fan_out, so main was left unchanged. The team now runs a stack sweep workflow: each binary is measured at 16 shifts from 0 to 3840 bytes, and an A/A control[3] shows the noise of the setup itself. A benchmark passes below +3%, fails above +5%, and gets a second run in between.
Repository tellus github.com
An actor framework for Rust with supervision, ordered death watch, event sourcing and clustering.
Read the original heikoseeberger.deDiscussion
Discussion
Commenters mostly point to a YouTube video as a good summary and note that memory layout can affect performance in ways developers cannot control. One commenter says the author mentions AI assistance only at the end of the text, and cites the Pangram detector as rating the text 74% AI-generated.
Links from the post and discussion
- Video a commenter calls a TL;DW of this topic youtube.com
- AI detector report cited by a commenter (74%) pangram.com
Sources
-
Heiko Seeberger
Where your stack lives can move a benchmark by 50%

