Stxxl
1.4.0
|
#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>
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 BDB_BULK_SCAN |
Definition at line 37 of file berkeley_db_benchmark.cpp.
#define BDB_FILE "/var/tmp/bdb_file" |
Definition at line 63 of file berkeley_db_benchmark.cpp.
Referenced by run_bdb_btree(), and run_bdb_btree_big().
#define DATA_SIZE 32 |
Definition at line 40 of file berkeley_db_benchmark.cpp.
Referenced by run_bdb_btree(), run_bdb_btree_big(), run_stxxl_map(), run_stxxl_map_big(), and run_tpie_btree_big().
#define KEY_SIZE 8 |
Definition at line 39 of file berkeley_db_benchmark.cpp.
Referenced by init(), operator!=(), operator<(), operator<<(), operator<=(), operator==(), operator>(), operator>=(), and rand_key().
#define LEAF_BLOCK_SIZE (32 * 1024) |
Definition at line 46 of file berkeley_db_benchmark.cpp.
Referenced by main(), and run_tpie_btree_big().
#define LEAF_BLOCK_SIZE (32 * 1024) |
Definition at line 46 of file berkeley_db_benchmark.cpp.
#define LEAF_CACHE_SIZE (TOTAL_CACHE_SIZE - NODE_CACHE_SIZE) |
Definition at line 55 of file berkeley_db_benchmark.cpp.
Referenced by run_stxxl_map(), run_stxxl_map_big(), and run_tpie_btree_big().
#define NODE_BLOCK_SIZE (32 * 1024) |
Definition at line 42 of file berkeley_db_benchmark.cpp.
Referenced by run_tpie_btree_big().
#define NODE_CACHE_SIZE (64 * 1024 * 1024) |
Definition at line 54 of file berkeley_db_benchmark.cpp.
Referenced by run_stxxl_map(), run_stxxl_map_big(), and run_tpie_btree_big().
Definition at line 190 of file berkeley_db_benchmark.cpp.
Referenced by main().
Definition at line 192 of file berkeley_db_benchmark.cpp.
Referenced by main().
Definition at line 189 of file berkeley_db_benchmark.cpp.
Referenced by main().
Definition at line 191 of file berkeley_db_benchmark.cpp.
Referenced by main().
#define SCAN_LIMIT | ( | x | ) | (x) |
Definition at line 60 of file berkeley_db_benchmark.cpp.
Referenced by run_bdb_btree_big(), run_stxxl_map_big(), and run_tpie_btree_big().
#define SORTER_MEM (TOTAL_CACHE_SIZE - 1024 * 1024 * 2 * 4) |
Definition at line 57 of file berkeley_db_benchmark.cpp.
Referenced by run_bdb_btree_big(), run_stxxl_map_big(), and run_tpie_btree_big().
#define TOTAL_CACHE_SIZE (750 * 1024 * 1024) |
Definition at line 48 of file berkeley_db_benchmark.cpp.
Referenced by main(), and run_tpie_btree_big().
typedef my_key bkey_t |
TPIE declarations.
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) |
Definition at line 187 of file berkeley_db_benchmark.cpp.
typedef AMI_STREAM<el_t> stream_t |
Definition at line 792 of file 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 |
Definition at line 194 of file berkeley_db_benchmark.cpp.
void init | ( | ) |
Definition at line 181 of file berkeley_db_benchmark.cpp.
References KEY_SIZE.
Referenced by stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::_STXXL_DEPRECATED(), stxxl::block_scheduler_algorithm_offline_lfd< SwappableBlockType >::block_scheduler_algorithm_offline_lfd(), stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::block_scheduler_algorithm_offline_lru_prefetching(), stxxl::block_scheduler_algorithm_online_lru< SwappableBlockType >::block_scheduler_algorithm_online_lru(), stxxl::block_scheduler_algorithm_simulation< SwappableBlockType >::block_scheduler_algorithm_simulation(), stxxl::config::config(), stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::deque2(), stxxl::priority_queue_local::ext_merger< BlockType_, Cmp_, Arity_, AllocStr_ >::ext_merger(), main(), stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::queue(), stxxl::RC::RC(), stxxl::SR::SR(), and stxxl::stable_ksort().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 1253 of file berkeley_db_benchmark.cpp.
References stxxl::atoint64(), init(), LEAF_BLOCK_SIZE, REAL_LEAF_BLOCK_SIZE, REAL_LEAF_MELEMENTS, REAL_NODE_BLOCK_SIZE, REAL_NODE_MELEMENTS, run_bdb_btree(), run_bdb_btree_big(), run_stxxl_map(), run_stxxl_map_big(), run_tpie_btree_big(), STXXL_MSG, and TOTAL_CACHE_SIZE.
long long unsigned myrand | ( | ) | [inline] |
Definition at line 215 of file berkeley_db_benchmark.cpp.
Referenced by rand_key(), run_ledasm_insert_all_delete_all(), run_ledasm_intermixed(), run_stxxl_insert_all_delete_all(), and run_stxxl_intermixed().
bool operator!= | ( | const my_key & | a, |
const my_key & | b | ||
) |
Definition at line 96 of file berkeley_db_benchmark.cpp.
References KEY_SIZE.
Referenced by stxxl::btree::btree_iterator< SelfType >::operator!=(), and stxxl::btree::btree_const_iterator< BTreeType >::operator!=().
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 | ||
) |
Definition at line 111 of file berkeley_db_benchmark.cpp.
References KEY_SIZE.
bool operator== | ( | const my_key & | a, |
const my_key & | b | ||
) |
Definition at line 91 of file berkeley_db_benchmark.cpp.
References KEY_SIZE.
Referenced by stxxl::btree::btree_iterator< SelfType >::operator==(), and stxxl::btree::btree_const_iterator< BTreeType >::operator==().
bool operator> | ( | const my_key & | a, |
const my_key & | b | ||
) |
Definition at line 106 of file berkeley_db_benchmark.cpp.
References KEY_SIZE.
bool operator>= | ( | const my_key & | a, |
const my_key & | b | ||
) |
Definition at line 116 of file berkeley_db_benchmark.cpp.
References KEY_SIZE.
void rand_key | ( | stxxl::int64 | , |
my_key & | Key | ||
) | [inline] |
Definition at line 219 of file berkeley_db_benchmark.cpp.
References KEY_SIZE, and myrand().
Referenced by run_bdb_btree(), run_bdb_btree_big(), run_stxxl_map(), run_stxxl_map_big(), and run_tpie_btree_big().
void run_bdb_btree | ( | stxxl::int64 | ops | ) |
Definition at line 230 of file berkeley_db_benchmark.cpp.
References BDB_FILE, cachesize, DATA_SIZE, stxxl::timer::mseconds(), pagesize, rand_key(), stxxl::timer::reset(), stxxl::timer::start(), stxxl::timer::stop(), STXXL_MSG, and std::swap().
Referenced by main().
void run_bdb_btree_big | ( | stxxl::int64 | n, |
unsigned | ops | ||
) |
Definition at line 985 of file berkeley_db_benchmark.cpp.
References BDB_FILE, stxxl::vector< Tp_, PgSz_, PgTp_, BlkSize_, AllocStr_, SzTp_ >::begin(), cachesize, DATA_SIZE, logbufsize, stxxl::stream::materialize(), stxxl::timer::mseconds(), pagesize, rand_key(), stxxl::timer::reset(), SCAN_LIMIT, SORTER_MEM, stxxl::timer::start(), stxxl::timer::stop(), STXXL_MSG, and std::swap().
Referenced by main().
void run_stxxl_map | ( | stxxl::int64 | ops | ) |
Definition at line 409 of file berkeley_db_benchmark.cpp.
References DATA_SIZE, LEAF_CACHE_SIZE, stxxl::timer::mseconds(), NODE_CACHE_SIZE, rand_key(), stxxl::timer::reset(), stxxl::timer::start(), stxxl::timer::stop(), STXXL_MSG, and std::swap().
Referenced by main().
void run_stxxl_map_big | ( | stxxl::int64 | n, |
unsigned | ops | ||
) |
Definition at line 599 of file berkeley_db_benchmark.cpp.
References stxxl::vector< Tp_, PgSz_, PgTp_, BlkSize_, AllocStr_, SzTp_ >::begin(), DATA_SIZE, stxxl::vector< Tp_, PgSz_, PgTp_, BlkSize_, AllocStr_, SzTp_ >::end(), LEAF_CACHE_SIZE, stxxl::stream::materialize(), stxxl::timer::mseconds(), NODE_CACHE_SIZE, rand_key(), stxxl::timer::reset(), SCAN_LIMIT, SORTER_MEM, stxxl::timer::start(), stxxl::timer::stop(), STXXL_MSG, and std::swap().
Referenced by main().
void run_tpie_btree_big | ( | stxxl::int64 | n, |
unsigned | ops | ||
) |
Definition at line 806 of file berkeley_db_benchmark.cpp.
References DATA_SIZE, LEAF_BLOCK_SIZE, LEAF_CACHE_SIZE, stxxl::timer::mseconds(), NODE_BLOCK_SIZE, NODE_CACHE_SIZE, rand_key(), stxxl::timer::reset(), SCAN_LIMIT, SORTER_MEM, stxxl::timer::start(), stxxl::timer::stop(), STXXL_MSG, and TOTAL_CACHE_SIZE.
Referenced by main().
u_int bulkbufsize = 4 * 1024 * 1024 |
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) |
Definition at line 70 of file berkeley_db_benchmark.cpp.
Referenced by run_bdb_btree(), and run_bdb_btree_big().
u_int datasize = 32 |
Definition at line 71 of file berkeley_db_benchmark.cpp.
char dummy |
Definition at line 794 of file berkeley_db_benchmark.cpp.
Referenced by main(), and stxxl::fileperblock_file< base_file_type >::serve().
u_int keysize = 8 |
Definition at line 72 of file berkeley_db_benchmark.cpp.
const char* letters = "abcdefghijklmnopqrstuvwxuz" |
Definition at line 75 of file berkeley_db_benchmark.cpp.
u_int logbufsize = 8 * 1024 * 1024 |
Definition at line 69 of file berkeley_db_benchmark.cpp.
Referenced by run_bdb_btree_big().
my_key max_key |
Definition at line 134 of file berkeley_db_benchmark.cpp.
Referenced by main().
my_key min_key |
Definition at line 134 of file berkeley_db_benchmark.cpp.
u_int numitems = 0 |
Definition at line 73 of file berkeley_db_benchmark.cpp.
u_int32_t pagesize = (32 * 1024) |
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.