Skip to content

Comment on 3.7X speedup from removing a call to sleep

Comments

To be fair, it's a sleep(0), which I assume is just the easiest way to get the process to context switch. I assume this is a speed improvement only when locks become ready sooner than a context switch.

The real fix would be to make context switches faster, this is just a data-driven tweak rather than a general solution.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.