libcopp  1.1.0
Macros | Typedefs | Functions | Variables
sample_benchmark_coroutine_stack_pool.cpp File Reference
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <inttypes.h>
#include <stdint.h>
#include <libcopp/coroutine/coroutine_context_container.h>
#include <libcopp/stack/stack_pool.h>
Include dependency graph for sample_benchmark_coroutine_stack_pool.cpp:

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
 

Macro Definition Documentation

#define CALC_CLOCK_NOW ( )    clock()

Definition at line 30 of file sample_benchmark_coroutine_stack_pool.cpp.

Referenced by benchmark_round().

#define CALC_CLOCK_T   clock_t

Definition at line 29 of file sample_benchmark_coroutine_stack_pool.cpp.

Referenced by benchmark_round().

#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.

Referenced by benchmark_round().

#define CALC_NS_AVG_CLOCK (   x,
 
)    (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.

Referenced by benchmark_round().

Typedef Documentation

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.

Function Documentation

static void benchmark_round ( int  index)
static
int main ( int  argc,
char *  argv[] 
)
static int my_runner ( void *  )
static

Variable Documentation

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 55 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().