mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-22 01:20:39 +00:00
swapcontext() is expensive as it invokes system calls. Replace it with setjmp()/longjmp(). We still use setcontext() initially, since that's the most reasonable portable method of setting up a stack. Context switch time (measured by thread_context_switch) is reduced to 120ns (from 450ns), with inefficiencies in the test itself and in future<> dominating.
3.0 KiB
3.0 KiB