perf/core: Reduce context switch overhead