xapian-core
1.4.27
|
performance tests involving a randomly generated index More...
#include <config.h>
#include "perftest/perftest_randomidx.h"
#include <cstdlib>
#include <string>
#include <xapian.h>
#include "backendmanager.h"
#include "perftest.h"
#include "str.h"
#include "testrunner.h"
#include "testsuite.h"
#include "testutils.h"
Go to the source code of this file.
Functions | |
static unsigned int | rand_int (unsigned int range) |
Generate a random integer from 0 to "range" - 1. More... | |
static unsigned int | rand_int (unsigned int min, unsigned int max) |
Generate a random integer from min to max. More... | |
static double | rand_01 () |
Generate a random double in range 0.0 <= v < 1.0. More... | |
static string | gen_word (unsigned int length, unsigned int char_range) |
Generate a "word", of the specified length. More... | |
DEFINE_TESTCASE (randomidx1, writable &&!inmemory) | |
performance tests involving a randomly generated index
Definition in file perftest_randomidx.cc.
DEFINE_TESTCASE | ( | randomidx1 | , |
writable &&! | inmemory | ||
) |
Definition at line 82 of file perftest_randomidx.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), Xapian::Document::add_value(), backendmanager, Xapian::WritableDatabase::commit(), gen_word(), BackendManager::get_writable_database(), PerfTestLogger::indexing_add(), PerfTestLogger::indexing_begin(), PerfTestLogger::indexing_end(), logger, rand_01(), rand_int(), seed, Xapian::Document::set_data(), Xapian::Internal::str(), PerfTestLogger::testcase_begin(), and PerfTestLogger::testcase_end().
|
static |
Generate a "word", of the specified length.
length | The length of the word to generate. |
char_range | The range of characters to use in the word. |
Definition at line 70 of file perftest_randomidx.cc.
References rand_int().
Referenced by DEFINE_TESTCASE().
|
static |
Generate a random double in range 0.0 <= v < 1.0.
Definition at line 59 of file perftest_randomidx.cc.
Referenced by DEFINE_TESTCASE().
|
static |
Generate a random integer from 0 to "range" - 1.
Definition at line 43 of file perftest_randomidx.cc.
Referenced by DEFINE_TESTCASE(), and gen_word().
|
static |
Generate a random integer from min to max.
Definition at line 51 of file perftest_randomidx.cc.