Stxxl  1.4.0
Defines | Typedefs | Functions | Variables
containers/berkeley_db_benchmark.cpp File Reference
#include <stxxl/vector>
#include <stxxl/map>
#include <stxxl/timer>
#include <stxxl/stream>
#include <db_cxx.h>
#include "app_config.h"
#include <portability.h>
#include <ami_btree.h>
Include dependency graph for berkeley_db_benchmark.cpp:

Go to the source code of this file.

Defines

#define BDB_BULK_SCAN
#define KEY_SIZE   8
#define DATA_SIZE   32
#define NODE_BLOCK_SIZE   (32 * 1024)
#define LEAF_BLOCK_SIZE   (32 * 1024)
#define LEAF_BLOCK_SIZE   (32 * 1024)
#define TOTAL_CACHE_SIZE   (750 * 1024 * 1024)
#define NODE_CACHE_SIZE   (64 * 1024 * 1024)
#define LEAF_CACHE_SIZE   (TOTAL_CACHE_SIZE - NODE_CACHE_SIZE)
#define SORTER_MEM   (TOTAL_CACHE_SIZE - 1024 * 1024 * 2 * 4)
#define SCAN_LIMIT(x)   (x)
#define BDB_FILE   "/var/tmp/bdb_file"
#define REAL_NODE_BLOCK_SIZE   map_type::node_block_type::raw_size
#define REAL_LEAF_BLOCK_SIZE   map_type::leaf_block_type::raw_size
#define REAL_NODE_MELEMENTS   map_type::node_block_type::size
#define REAL_LEAF_MELEMENTS   map_type::leaf_block_type::size

Typedefs

typedef my_key bkey_t
 TPIE declarations.
typedef AMI_btree< bkey_t,
el_t, less< bkey_t >
, key_from_el > 
u_btree_t
typedef stxxl::map< my_key,
my_data, comp_type,(32 *1024),(32 *1024) 
map_type )
typedef
stxxl::VECTOR_GENERATOR
< std::pair< my_key, my_data >
, 1, 1 >::result 
vector_type
typedef AMI_STREAM< el_t > stream_t

Functions

std::ostream & operator<< (std::ostream &o, const my_key &obj)
bool operator== (const my_key &a, const my_key &b)
bool operator!= (const my_key &a, const my_key &b)
bool operator< (const my_key &a, const my_key &b)
bool operator> (const my_key &a, const my_key &b)
bool operator<= (const my_key &a, const my_key &b)
bool operator>= (const my_key &a, const my_key &b)
std::ostream & operator<< (std::ostream &o, const my_data &obj)
void init ()
long long unsigned myrand ()
void rand_key (stxxl::int64, my_key &Key)
void run_bdb_btree (stxxl::int64 ops)
void run_stxxl_map (stxxl::int64 ops)
void run_stxxl_map_big (stxxl::int64 n, unsigned ops)
void run_tpie_btree_big (stxxl::int64 n, unsigned ops)
void run_bdb_btree_big (stxxl::int64 n, unsigned ops)
int main (int argc, char *argv[])

Variables

u_int32_t pagesize = (32 * 1024)
u_int bulkbufsize = 4 * 1024 * 1024
u_int logbufsize = 8 * 1024 * 1024
u_int cachesize = ( (750 * 1024 * 1024) < 500 * 1024 * 1024) ? (4 * ( (750 * 1024 * 1024) / 5)) : ( (750 * 1024 * 1024) - 100 * 1024 * 1024)
u_int datasize = 32
u_int keysize = 8
u_int numitems = 0
const char * letters = "abcdefghijklmnopqrstuvwxuz"
my_key min_key
my_key max_key
long long unsigned ran32State = 0xdeadbeef
char dummy

Define Documentation

#define BDB_BULK_SCAN

Definition at line 37 of file berkeley_db_benchmark.cpp.

#define BDB_FILE   "/var/tmp/bdb_file"
Examples:
containers/berkeley_db_benchmark.cpp.

Definition at line 63 of file berkeley_db_benchmark.cpp.

Referenced by run_bdb_btree(), and run_bdb_btree_big().

#define DATA_SIZE   32
#define KEY_SIZE   8
#define LEAF_BLOCK_SIZE   (32 * 1024)
#define LEAF_BLOCK_SIZE   (32 * 1024)

Definition at line 46 of file berkeley_db_benchmark.cpp.

#define NODE_BLOCK_SIZE   (32 * 1024)
#define NODE_CACHE_SIZE   (64 * 1024 * 1024)
Examples:
containers/berkeley_db_benchmark.cpp.

Definition at line 190 of file berkeley_db_benchmark.cpp.

Referenced by main().

Examples:
containers/berkeley_db_benchmark.cpp.

Definition at line 192 of file berkeley_db_benchmark.cpp.

Referenced by main().

Examples:
containers/berkeley_db_benchmark.cpp.

Definition at line 189 of file berkeley_db_benchmark.cpp.

Referenced by main().

Examples:
containers/berkeley_db_benchmark.cpp.

Definition at line 191 of file berkeley_db_benchmark.cpp.

Referenced by main().

#define SCAN_LIMIT (   x)    (x)
#define SORTER_MEM   (TOTAL_CACHE_SIZE - 1024 * 1024 * 2 * 4)
#define TOTAL_CACHE_SIZE   (750 * 1024 * 1024)
Examples:
containers/berkeley_db_benchmark.cpp.

Definition at line 48 of file berkeley_db_benchmark.cpp.

Referenced by main(), and run_tpie_btree_big().


Typedef Documentation

typedef my_key bkey_t

TPIE declarations.

Examples:
containers/berkeley_db_benchmark.cpp.

Definition at line 155 of file berkeley_db_benchmark.cpp.

typedef stxxl::map<my_key, my_data, comp_type, (32 * 1024) , (32 * 1024) map_type)
Examples:
containers/berkeley_db_benchmark.cpp.

Definition at line 187 of file berkeley_db_benchmark.cpp.

typedef AMI_STREAM<el_t> stream_t
Examples:
containers/berkeley_db_benchmark.cpp.

Definition at line 792 of file berkeley_db_benchmark.cpp.

typedef AMI_btree<bkey_t, el_t, less<bkey_t>, key_from_el> u_btree_t
Examples:
containers/berkeley_db_benchmark.cpp.

Definition at line 177 of file berkeley_db_benchmark.cpp.

typedef stxxl::VECTOR_GENERATOR<std::pair<my_key, my_data>, 1, 1>::result vector_type

Function Documentation

void init ( )
int main ( int  argc,
char *  argv[] 
)
long long unsigned myrand ( ) [inline]
bool operator!= ( const my_key &  a,
const my_key &  b 
)
bool operator< ( const my_key &  a,
const my_key &  b 
)

Definition at line 101 of file berkeley_db_benchmark.cpp.

References KEY_SIZE.

std::ostream& operator<< ( std::ostream &  o,
const my_key &  obj 
)

Definition at line 83 of file berkeley_db_benchmark.cpp.

References KEY_SIZE.

std::ostream& operator<< ( std::ostream &  o,
const my_data &  obj 
)

Definition at line 127 of file berkeley_db_benchmark.cpp.

bool operator<= ( const my_key &  a,
const my_key &  b 
)
bool operator== ( const my_key &  a,
const my_key &  b 
)
bool operator> ( const my_key &  a,
const my_key &  b 
)
bool operator>= ( const my_key &  a,
const my_key &  b 
)
Examples:
containers/berkeley_db_benchmark.cpp.

Definition at line 116 of file berkeley_db_benchmark.cpp.

References KEY_SIZE.

void rand_key ( stxxl::int64  ,
my_key &  Key 
) [inline]
void run_bdb_btree ( stxxl::int64  ops)
void run_bdb_btree_big ( stxxl::int64  n,
unsigned  ops 
)
void run_stxxl_map ( stxxl::int64  ops)
void run_stxxl_map_big ( stxxl::int64  n,
unsigned  ops 
)
void run_tpie_btree_big ( stxxl::int64  n,
unsigned  ops 
)

Variable Documentation

u_int bulkbufsize = 4 * 1024 * 1024
Examples:
containers/berkeley_db_benchmark.cpp.

Definition at line 68 of file berkeley_db_benchmark.cpp.

u_int cachesize = ( (750 * 1024 * 1024) < 500 * 1024 * 1024) ? (4 * ( (750 * 1024 * 1024) / 5)) : ( (750 * 1024 * 1024) - 100 * 1024 * 1024)
Examples:
containers/berkeley_db_benchmark.cpp.

Definition at line 70 of file berkeley_db_benchmark.cpp.

Referenced by run_bdb_btree(), and run_bdb_btree_big().

u_int datasize = 32
Examples:
containers/berkeley_db_benchmark.cpp.

Definition at line 71 of file berkeley_db_benchmark.cpp.

char dummy
u_int keysize = 8
Examples:
containers/berkeley_db_benchmark.cpp.

Definition at line 72 of file berkeley_db_benchmark.cpp.

const char* letters = "abcdefghijklmnopqrstuvwxuz"
Examples:
containers/berkeley_db_benchmark.cpp.

Definition at line 75 of file berkeley_db_benchmark.cpp.

u_int logbufsize = 8 * 1024 * 1024
Examples:
containers/berkeley_db_benchmark.cpp.

Definition at line 69 of file berkeley_db_benchmark.cpp.

Referenced by run_bdb_btree_big().

my_key max_key
Examples:
containers/berkeley_db_benchmark.cpp.

Definition at line 134 of file berkeley_db_benchmark.cpp.

Referenced by main().

my_key min_key
Examples:
containers/berkeley_db_benchmark.cpp.

Definition at line 134 of file berkeley_db_benchmark.cpp.

u_int numitems = 0
Examples:
containers/berkeley_db_benchmark.cpp.

Definition at line 73 of file berkeley_db_benchmark.cpp.

u_int32_t pagesize = (32 * 1024)
Examples:
containers/berkeley_db_benchmark.cpp.

Definition at line 67 of file berkeley_db_benchmark.cpp.

Referenced by run_bdb_btree(), and run_bdb_btree_big().

long long unsigned ran32State = 0xdeadbeef

Definition at line 214 of file berkeley_db_benchmark.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines