Spice achieves efficient parallelism in Zig with sub-nanosecond overhead using heartbeat scheduling. Threads never compete, and adding more threads won’t slow down the program. Comparing to Rayon, Spice shows lower overhead, providing linear speed-up at first. Spice might scale slightly worse, but its low overhead ensures practical speed-up. The benchmark scenario highlights Spice’s ability to maintain performance with minimal overhead. Spice addresses work-stealing inefficiencies, optimizes for static dispatch, uses low-overhead heartbeating signaling, and eliminates global mutex contention. It also implements branch-free doubly-linked lists and minimizes stack usage for optimal performance. Spice is ideal for parallel processing with minimal slowdown.
https://github.com/judofyr/spice