|
libcopp 2.3.1
|
#include <inttypes.h>#include <stdint.h>#include <cstdio>#include <cstdlib>#include <cstring>#include <ctime>#include <libcopp/coroutine/coroutine_context_container.h>#include <libcopp/stack/stack_pool.h>
Go to the source code of this file.
Macros | |
| #define | CALC_CLOCK_T clock_t |
| #define | CALC_CLOCK_NOW() clock() |
| #define | CALC_MS_CLOCK(x) static_cast<int>((x) / (CLOCKS_PER_SEC / 1000)) |
| #define | CALC_NS_AVG_CLOCK(x, y) (1000000LL * static_cast<long long>((x) / (CLOCKS_PER_SEC / 1000)) / (y ? y : 1)) |
Typedefs | |
| typedef copp::stack_pool< copp::allocator::default_statck_allocator > | stack_pool_t |
| typedef copp::coroutine_context_container< copp::allocator::stack_allocator_pool< stack_pool_t > > | my_cotoutine_t |
Functions | |
| static int | my_runner (void *) |
| static void | benchmark_round (int index) |
| int | main (int argc, char *argv[]) |
Variables | |
| stack_pool_t::ptr_t | global_stack_pool |
| int | switch_count = 100 |
| int | MAX_COROUTINE_NUMBER = 100000 |
| #define CALC_CLOCK_NOW | ( | ) | clock() |
Definition at line 30 of file sample_benchmark_coroutine_stack_pool.cpp.
| #define CALC_CLOCK_T clock_t |
Definition at line 29 of file sample_benchmark_coroutine_stack_pool.cpp.
| #define CALC_MS_CLOCK | ( | x | ) | static_cast<int>((x) / (CLOCKS_PER_SEC / 1000)) |
Definition at line 31 of file sample_benchmark_coroutine_stack_pool.cpp.
| #define CALC_NS_AVG_CLOCK | ( | x, | |
| y | |||
| ) | (1000000LL * static_cast<long long>((x) / (CLOCKS_PER_SEC / 1000)) / (y ? y : 1)) |
Definition at line 32 of file sample_benchmark_coroutine_stack_pool.cpp.
| typedef copp::coroutine_context_container<copp::allocator::stack_allocator_pool<stack_pool_t> > my_cotoutine_t |
Definition at line 40 of file sample_benchmark_coroutine_stack_pool.cpp.
| typedef copp::stack_pool<copp::allocator::default_statck_allocator> stack_pool_t |
Definition at line 36 of file sample_benchmark_coroutine_stack_pool.cpp.
|
static |
Definition at line 56 of file sample_benchmark_coroutine_stack_pool.cpp.
References CALC_CLOCK_NOW, CALC_CLOCK_T, CALC_MS_CLOCK, CALC_NS_AVG_CLOCK, co_arr, global_stack_pool, and MAX_COROUTINE_NUMBER.
Referenced by main().
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Definition at line 128 of file sample_benchmark_coroutine_stack_pool.cpp.
References benchmark_round(), global_stack_pool, MAX_COROUTINE_NUMBER, and switch_count.
|
static |
Definition at line 43 of file sample_benchmark_coroutine_stack_pool.cpp.
References switch_count.
| stack_pool_t::ptr_t global_stack_pool |
Definition at line 37 of file sample_benchmark_coroutine_stack_pool.cpp.
Referenced by benchmark_round(), and main().
| int MAX_COROUTINE_NUMBER = 100000 |
Definition at line 54 of file sample_benchmark_coroutine_stack_pool.cpp.
Referenced by benchmark_round(), and main().
| int switch_count = 100 |
Definition at line 38 of file sample_benchmark_coroutine_stack_pool.cpp.
Referenced by main(), and my_runner().