Stack-allocated data typically benefits from better cache locality due to its contiguous nature and ordered management, leading to faster access and potentially boosting the performance of CPU-bound operations within `nogil` blocks compared to fragmented heap memory. [9, 12, 13, 16]