Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Click here to view the latest version of this page.
PrevUpHomeNext

Performance

Performance of Boost.Context was measured on the platforms shown in the following table. Performance measurements were taken using rdtsc and boost::chrono::high_resolution_clock, with overhead corrections, on x86 platforms. In each case, cache warm-up was accounted for, and the one running thread was pinned to a single CPU. The code was compiled using the build options, 'variant = release cxxflags = -DBOOST_DISABLE_ASSERTS'.

Table 1.1. Performance of context switch

Platform

ucontext_t

fcontext_t

execution_context

windows fibers

i386 [a]

708 ns / 754 cycles

37 ns / 37 cycles

ns / cycles

ns / cycles

x86_64 [b]

547 ns / 1433 cycles

8 ns / 23 cycles

16 ns / 46 cycles

ns / cycles

[a] AMD Athlon 64 DualCore 4400+

[b] Intel Core2 Q6700



PrevUpHomeNext