OpenCog Framework
Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
|
#include <AtomSpaceBenchmark.h>
Classes | |
struct | TimeStats |
Public Types | |
enum | BenchType { BENCH_AS = 1, BENCH_TABLE, BENCH_SCM, BENCH_PYTHON } |
typedef timepair_t(AtomSpaceBenchmark::* | BMFn )() |
Public Member Functions | |
void | printTypeSizes () |
size_t | estimateOfAtomSize (Handle h) |
AtomSpaceBenchmark () | |
~AtomSpaceBenchmark () | |
void | setMethod (std::string method) |
void | showMethods () |
void | startBenchmark (int numThreads=1) |
void | doBenchmark (const std::string &methodName, BMFn methodToCall) |
void | buildAtomSpace (long atomspaceSize=(1<< 16), float percentLinks=0.1, bool display=true) |
Handle | getRandomHandle () |
void | setTestAllMethods () |
timepair_t | bm_noop () |
timepair_t | bm_addNode () |
timepair_t | bm_addLink () |
timepair_t | bm_rmAtom () |
timepair_t | bm_getType () |
timepair_t | bm_getHandlesByType () |
timepair_t | bm_getOutgoingSet () |
timepair_t | bm_getIncomingSet () |
timepair_t | bm_getTruthValue () |
timepair_t | bm_setTruthValue () |
Public Attributes | |
unsigned int | Nreps |
unsigned int | Nloops |
bool | memoize |
bool | compile |
int | sizeIncrease |
bool | saveToFile |
int | saveInterval |
bool | doStats |
bool | buildTestData |
unsigned long | randomseed |
BenchType | testKind |
UUID | UUID_begin |
UUID | UUID_end |
std::vector< BMFn > | methodsToTest |
float | percentLinks |
long | atomCount |
bool | showTypeSizes |
number of nodes to build atomspace with before testing More... | |
float | chanceUseDefaultTV |
Private Types | |
typedef boost::tuple< size_t, clock_t, long > | record_t |
Private Member Functions | |
void | recordToFile (std::ofstream &file, const record_t record) const |
Type | randomType (Type t) |
clock_t | makeRandomNode (const std::string &s) |
clock_t | makeRandomLink () |
long | getMemUsage () |
std::string | memoize_or_compile (std::string) |
Private Attributes | |
float | linkSize_mean |
Type | defaultLinkType |
float | chanceOfNonDefaultLink |
Type | defaultNodeType |
float | chanceOfNonDefaultNode |
float | maxSize |
AtomSpace * | asp |
never make the atomspace bigger than this while building it More... | |
AtomTable * | atab |
SchemeEval * | scm |
PythonEval * | pyev |
MT19937RandGen * | rng |
std::default_random_engine | randgen |
std::poisson_distribution < unsigned > * | prg |
Type | numberOfTypes |
int | counter |
std::vector< std::string > | methodNames |
Definition at line 24 of file AtomSpaceBenchmark.h.
typedef timepair_t(AtomSpaceBenchmark::* opencog::AtomSpaceBenchmark::BMFn)() |
Definition at line 104 of file AtomSpaceBenchmark.h.
|
private |
Definition at line 27 of file AtomSpaceBenchmark.h.
Enumerator | |
---|---|
BENCH_AS | |
BENCH_TABLE | |
BENCH_SCM | |
BENCH_PYTHON |
Definition at line 92 of file AtomSpaceBenchmark.h.
opencog::AtomSpaceBenchmark::AtomSpaceBenchmark | ( | ) |
Definition at line 42 of file AtomSpaceBenchmark.cc.
opencog::AtomSpaceBenchmark::~AtomSpaceBenchmark | ( | ) |
Definition at line 79 of file AtomSpaceBenchmark.cc.
timepair_t opencog::AtomSpaceBenchmark::bm_addLink | ( | ) |
timepair_t opencog::AtomSpaceBenchmark::bm_addNode | ( | ) |
timepair_t opencog::AtomSpaceBenchmark::bm_getHandlesByType | ( | ) |
Definition at line 1019 of file AtomSpaceBenchmark.cc.
References python.undocumented.blocksworld::t.
timepair_t opencog::AtomSpaceBenchmark::bm_getIncomingSet | ( | ) |
Definition at line 1105 of file AtomSpaceBenchmark.cc.
References opencog::Atom::getIncomingSet(), and opencog::Handle::value().
timepair_t opencog::AtomSpaceBenchmark::bm_getOutgoingSet | ( | ) |
Definition at line 1057 of file AtomSpaceBenchmark.cc.
References opencog::Handle::value().
timepair_t opencog::AtomSpaceBenchmark::bm_getTruthValue | ( | ) |
Definition at line 903 of file AtomSpaceBenchmark.cc.
References opencog::Atom::getTruthValue(), and opencog::Handle::value().
timepair_t opencog::AtomSpaceBenchmark::bm_getType | ( | ) |
Definition at line 853 of file AtomSpaceBenchmark.cc.
References opencog::Atom::getType(), and opencog::Handle::value().
timepair_t opencog::AtomSpaceBenchmark::bm_noop | ( | ) |
timepair_t opencog::AtomSpaceBenchmark::bm_rmAtom | ( | ) |
Definition at line 776 of file AtomSpaceBenchmark.cc.
References opencog::Atom::getIncomingSetSize(), and opencog::Handle::value().
timepair_t opencog::AtomSpaceBenchmark::bm_setTruthValue | ( | ) |
Definition at line 960 of file AtomSpaceBenchmark.cc.
References opencog::SimpleTruthValue::createTV(), opencog::Atom::setTruthValue(), and opencog::Handle::value().
void opencog::AtomSpaceBenchmark::buildAtomSpace | ( | long | atomspaceSize = (1 << 16) , |
float | percentLinks = 0.1 , |
||
bool | display = true |
||
) |
Definition at line 704 of file AtomSpaceBenchmark.cc.
References DIVIDER_LINE, opencog::TLB::getMaxUUID(), and PROGRESS_BAR_LENGTH.
void opencog::AtomSpaceBenchmark::doBenchmark | ( | const std::string & | methodName, |
BMFn | methodToCall | ||
) |
Definition at line 288 of file AtomSpaceBenchmark.cc.
References CALL_MEMBER_FN, DIVIDER_LINE, opencog::AtomSpaceBenchmark::TimeStats::print(), PROGRESS_BAR_LENGTH, and python.undocumented.blocksworld::t.
size_t opencog::AtomSpaceBenchmark::estimateOfAtomSize | ( | Handle | h | ) |
Definition at line 87 of file AtomSpaceBenchmark.cc.
References opencog::COUNT_TRUTH_VALUE, opencog::AttentionValue::DEFAULT_AV(), opencog::TruthValue::DEFAULT_TV(), opencog::Atom::getAttentionValue(), opencog::Atom::getTruthValue(), opencog::INDEFINITE_TRUTH_VALUE, opencog::LinkCast(), opencog::NodeCast(), and opencog::SIMPLE_TRUTH_VALUE.
|
private |
Definition at line 133 of file AtomSpaceBenchmark.cc.
Handle opencog::AtomSpaceBenchmark::getRandomHandle | ( | ) |
Definition at line 842 of file AtomSpaceBenchmark.cc.
|
private |
Definition at line 610 of file AtomSpaceBenchmark.cc.
References opencog::classserver(), createLink, opencog::ClassServer::getTypeName(), and python.undocumented.blocksworld::t.
|
private |
Definition at line 502 of file AtomSpaceBenchmark.cc.
References opencog::classserver(), createNode, opencog::TruthValue::DEFAULT_TV(), opencog::ClassServer::getTypeName(), and python.undocumented.blocksworld::t.
|
private |
Definition at line 451 of file AtomSpaceBenchmark.cc.
void opencog::AtomSpaceBenchmark::printTypeSizes | ( | ) |
Definition at line 144 of file AtomSpaceBenchmark.cc.
References createLink, DIVIDER_LINE, LK, and ND.
Definition at line 483 of file AtomSpaceBenchmark.cc.
References opencog::classserver().
|
private |
Definition at line 1184 of file AtomSpaceBenchmark.cc.
void opencog::AtomSpaceBenchmark::setMethod | ( | std::string | method | ) |
Definition at line 208 of file AtomSpaceBenchmark.cc.
References bm_addLink(), bm_addNode(), bm_getHandlesByType(), bm_getIncomingSet(), bm_getOutgoingSet(), bm_getTruthValue(), bm_getType(), bm_noop(), bm_rmAtom(), and bm_setTruthValue().
|
inline |
Definition at line 125 of file AtomSpaceBenchmark.h.
References setMethod().
void opencog::AtomSpaceBenchmark::showMethods | ( | ) |
Definition at line 191 of file AtomSpaceBenchmark.cc.
void opencog::AtomSpaceBenchmark::startBenchmark | ( | int | numThreads = 1 | ) |
Definition at line 377 of file AtomSpaceBenchmark.cc.
References opencog::classserver(), opencog::TLB::getMaxUUID(), opencog::ClassServer::getNumberOfClasses(), opencog::PythonEval::instance(), and VERSION_STRING.
|
private |
never make the atomspace bigger than this while building it
Definition at line 53 of file AtomSpaceBenchmark.h.
|
private |
Definition at line 54 of file AtomSpaceBenchmark.h.
long opencog::AtomSpaceBenchmark::atomCount |
Definition at line 108 of file AtomSpaceBenchmark.h.
bool opencog::AtomSpaceBenchmark::buildTestData |
Definition at line 89 of file AtomSpaceBenchmark.h.
|
private |
Definition at line 47 of file AtomSpaceBenchmark.h.
|
private |
Definition at line 49 of file AtomSpaceBenchmark.h.
float opencog::AtomSpaceBenchmark::chanceUseDefaultTV |
Definition at line 138 of file AtomSpaceBenchmark.h.
bool opencog::AtomSpaceBenchmark::compile |
Definition at line 84 of file AtomSpaceBenchmark.h.
|
private |
Definition at line 74 of file AtomSpaceBenchmark.h.
|
private |
Definition at line 46 of file AtomSpaceBenchmark.h.
|
private |
Definition at line 48 of file AtomSpaceBenchmark.h.
bool opencog::AtomSpaceBenchmark::doStats |
Definition at line 88 of file AtomSpaceBenchmark.h.
|
private |
Definition at line 44 of file AtomSpaceBenchmark.h.
|
private |
Definition at line 51 of file AtomSpaceBenchmark.h.
bool opencog::AtomSpaceBenchmark::memoize |
Definition at line 83 of file AtomSpaceBenchmark.h.
|
private |
Definition at line 78 of file AtomSpaceBenchmark.h.
std::vector< BMFn > opencog::AtomSpaceBenchmark::methodsToTest |
Definition at line 105 of file AtomSpaceBenchmark.h.
unsigned int opencog::AtomSpaceBenchmark::Nloops |
Definition at line 82 of file AtomSpaceBenchmark.h.
unsigned int opencog::AtomSpaceBenchmark::Nreps |
Definition at line 81 of file AtomSpaceBenchmark.h.
|
private |
Definition at line 68 of file AtomSpaceBenchmark.h.
float opencog::AtomSpaceBenchmark::percentLinks |
Definition at line 107 of file AtomSpaceBenchmark.h.
|
private |
Definition at line 65 of file AtomSpaceBenchmark.h.
|
private |
Definition at line 59 of file AtomSpaceBenchmark.h.
|
private |
Definition at line 64 of file AtomSpaceBenchmark.h.
unsigned long opencog::AtomSpaceBenchmark::randomseed |
Definition at line 90 of file AtomSpaceBenchmark.h.
|
private |
Definition at line 62 of file AtomSpaceBenchmark.h.
int opencog::AtomSpaceBenchmark::saveInterval |
Definition at line 87 of file AtomSpaceBenchmark.h.
bool opencog::AtomSpaceBenchmark::saveToFile |
Definition at line 86 of file AtomSpaceBenchmark.h.
|
private |
Definition at line 56 of file AtomSpaceBenchmark.h.
bool opencog::AtomSpaceBenchmark::showTypeSizes |
number of nodes to build atomspace with before testing
Definition at line 110 of file AtomSpaceBenchmark.h.
int opencog::AtomSpaceBenchmark::sizeIncrease |
Definition at line 85 of file AtomSpaceBenchmark.h.
BenchType opencog::AtomSpaceBenchmark::testKind |
Definition at line 100 of file AtomSpaceBenchmark.h.
UUID opencog::AtomSpaceBenchmark::UUID_begin |
Definition at line 102 of file AtomSpaceBenchmark.h.
UUID opencog::AtomSpaceBenchmark::UUID_end |
Definition at line 103 of file AtomSpaceBenchmark.h.