6525451489
Summary: Start removing `is_remote` from `Address` Remove `GlobalAddress` Remove `GlobalizedAddress` Remove bitmasks from `Address` Remove `is_local` from `Address` Remove `is_local` from `RecordAccessor` Remove `worker_id` from `Address` Remove `worker_id` from `GidGenerator` Unfriend `IndexRpcServer` from `Storage` Remove `LocalizedAddressIfPossible` Make member private Remove `worker_id` from `Storage` Copy function to ease removal of distributed logic Remove `worker_id` from `WriteAheadLog` Remove `worker_id` from `GraphDb` Remove `worker_id` from durability Remove nonexistant function Remove `gid` from `Address` Remove usage of `Address` Remove `Address` Remove `VertexAddress` and `EdgeAddress` Fix Id test Remove `cypher_id` from `VersionList` Remove `cypher_id` from durability Remove `cypher_id` member from `VersionList` Remove `cypher_id` from database Fix recovery (revert D1142) Remove unnecessary functions from `GraphDbAccessor` Revert `InsertEdge` implementation to the way it was in/before D1142 Remove leftover `VertexAddress` from `Edge` Remove `PostCreateIndex` and `PopulateIndexFromBuildIndex` Split durability paths into single node and distributed Fix `TransactionIdFromWalFilename` implementation Fix tests Remove `cypher_id` from `snapshooter` and `durability` test Reviewers: msantl, teon.banek Reviewed By: msantl Subscribers: msantl, pullbot Differential Revision: https://phabricator.memgraph.io/D1647
70 lines
1.7 KiB
C++
70 lines
1.7 KiB
C++
#include <benchmark/benchmark.h>
|
|
#include <benchmark/benchmark_api.h>
|
|
#include <glog/logging.h>
|
|
|
|
#include "mvcc/single_node/record.hpp"
|
|
#include "mvcc/single_node/version_list.hpp"
|
|
#include "transactions/single_node/engine.hpp"
|
|
|
|
class Prop : public mvcc::Record<Prop> {
|
|
public:
|
|
Prop() = default;
|
|
Prop *CloneData() { return new Prop; }
|
|
};
|
|
|
|
// Benchmark multiple updates, and finds, focused on finds.
|
|
// This a rather weak test, but I'm not sure what's the better way to test this
|
|
// in the future.
|
|
// TODO(dgleich): Refresh this.
|
|
void MvccMix(benchmark::State &state) {
|
|
while (state.KeepRunning()) {
|
|
state.PauseTiming();
|
|
tx::Engine engine;
|
|
auto t1 = engine.Begin();
|
|
mvcc::VersionList<Prop> version_list(*t1, 0);
|
|
|
|
engine.Commit(*t1);
|
|
auto t2 = engine.Begin();
|
|
|
|
state.ResumeTiming();
|
|
version_list.update(*t2);
|
|
state.PauseTiming();
|
|
|
|
state.ResumeTiming();
|
|
version_list.find(*t2);
|
|
state.PauseTiming();
|
|
|
|
engine.Abort(*t2);
|
|
|
|
auto t3 = engine.Begin();
|
|
state.ResumeTiming();
|
|
version_list.update(*t3);
|
|
state.PauseTiming();
|
|
auto t4 = engine.Begin();
|
|
|
|
// Repeat find state.range(0) number of times.
|
|
state.ResumeTiming();
|
|
for (int i = 0; i < state.range(0); ++i) {
|
|
version_list.find(*t4);
|
|
}
|
|
state.PauseTiming();
|
|
|
|
engine.Commit(*t3);
|
|
engine.Commit(*t4);
|
|
state.ResumeTiming();
|
|
}
|
|
}
|
|
|
|
BENCHMARK(MvccMix)
|
|
->RangeMultiplier(2) // Multiply next range testdata size by 2
|
|
->Range(1 << 14, 1 << 23) // 1<<14, 1<<15, 1<<16, ...
|
|
->Unit(benchmark::kMillisecond);
|
|
|
|
int main(int argc, char **argv) {
|
|
google::InitGoogleLogging(argv[0]);
|
|
|
|
::benchmark::Initialize(&argc, argv);
|
|
::benchmark::RunSpecifiedBenchmarks();
|
|
return 0;
|
|
}
|