summaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-12-08 20:11:13 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2019-12-16 23:48:46 +0000
commitc72bdc628b4493bfb2974ab3fe479d2af0d376f1 (patch)
treece2f82f3f6f7cfd6ece7ac9ae06edef92986432f /vespalib
parent6b4486254e67b61e7dbe7dab30ae50d3b0bf01bb (diff)
WipeHistory has not been used for a very long time.
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/tests/btree/iteratespeed.cpp6
-rw-r--r--vespalib/src/tests/executor/stress_test.cpp22
-rw-r--r--vespalib/src/tests/simple_thread_bundle/threading_speed_test.cpp4
-rw-r--r--vespalib/src/tests/slime/summary-feature-benchmark/summary-feature-benchmark.cpp8
4 files changed, 20 insertions, 20 deletions
diff --git a/vespalib/src/tests/btree/iteratespeed.cpp b/vespalib/src/tests/btree/iteratespeed.cpp
index 82aa9bb5f54..e20e9537f7f 100644
--- a/vespalib/src/tests/btree/iteratespeed.cpp
+++ b/vespalib/src/tests/btree/iteratespeed.cpp
@@ -14,9 +14,9 @@
#include <vespa/vespalib/btree/btree.hpp>
#include <vespa/vespalib/btree/btreestore.hpp>
#include <vespa/vespalib/util/rand48.h>
+#include <vespa/vespalib/util/time.h>
#include <vespa/fastos/app.h>
-#include <vespa/fastos/timestamp.h>
#include <vespa/log/log.h>
LOG_SETUP("iteratespeed");
@@ -83,7 +83,7 @@ IterateSpeed::workLoop(int loops, bool enableForward, bool enableBackwards,
assert(numEntries == tree.size());
assert(tree.isValid());
for (int l = 0; l < loops; ++l) {
- fastos::StopWatch stopWatch;
+ vespalib::Timer timer;
uint64_t sum = 0;
for (size_t innerl = 0; innerl < numInnerLoops; ++innerl) {
if (iterateMethod == IterateMethod::FORWARD) {
@@ -106,7 +106,7 @@ IterateSpeed::workLoop(int loops, bool enableForward, bool enableBackwards,
[&](int key) { sum += key; } );
}
}
- double used = stopWatch.elapsed().sec();
+ double used = vespalib::to_s(timer.elapsed());
printf("Elapsed time for iterating %ld steps is %8.5f, "
"direction=%s, fanout=%u,%u, sum=%" PRIu64 "\n",
numEntries * numInnerLoops,
diff --git a/vespalib/src/tests/executor/stress_test.cpp b/vespalib/src/tests/executor/stress_test.cpp
index bbe754be2bd..01787e2e14c 100644
--- a/vespalib/src/tests/executor/stress_test.cpp
+++ b/vespalib/src/tests/executor/stress_test.cpp
@@ -60,28 +60,28 @@ uint32_t
Test::calibrate(double wanted_ms)
{
uint32_t n = 0;
- fastos::StopWatch t0;
- fastos::StopWatch t1;
+ vespalib::Timer t0;
+ vespalib::Timer t1;
{ // calibration of calibration loop
uint32_t result = 0;
- double ms;
+ vespalib::duration dur;
do {
result += doStuff(++n);
- t1.restart();
- ms = (t1.elapsed().ms() - t0.elapsed().ms());
- } while (ms < 1000.0);
+ t1 = vespalib::Timer();
+ dur = (t1.elapsed() - t0.elapsed());
+ } while (dur < 1s);
_result += result;
}
{ // calibrate loop
- t0.restart();
+ t0 = vespalib::Timer();
uint32_t result = 0;
for (uint32_t i = 0; i < n; ++i) {
result += doStuff(i);
}
_result += result;
- t1.restart();
+ t1 = vespalib::Timer();
}
- double ms = (t1.elapsed().ms() - t0.elapsed().ms());
+ double ms = vespalib::count_ms(t1.elapsed() - t0.elapsed());
double size = (((double)n) / ms) * wanted_ms;
return (uint32_t) std::round(size);
}
@@ -121,7 +121,7 @@ Test::Main()
fprintf(stderr, "all threads have been accounted for...\n");
}
{
- fastos::StopWatch t0;
+ vespalib::Timer t0;
fprintf(stderr, "starting task submission...\n");
uint32_t result = 0;
for (uint32_t i = 0; i < tasks; ++i) {
@@ -133,7 +133,7 @@ Test::Main()
}
}
executor.sync();
- double ms = t0.elapsed().ms();
+ double ms = vespalib::count_ms(t0.elapsed());
fprintf(stderr, "total execution wall time: %g ms\n", ms);
_result += result;
}
diff --git a/vespalib/src/tests/simple_thread_bundle/threading_speed_test.cpp b/vespalib/src/tests/simple_thread_bundle/threading_speed_test.cpp
index d67c417b71a..50ee6296f16 100644
--- a/vespalib/src/tests/simple_thread_bundle/threading_speed_test.cpp
+++ b/vespalib/src/tests/simple_thread_bundle/threading_speed_test.cpp
@@ -57,11 +57,11 @@ TEST("estimate cost of thread bundle fork/join") {
}
double minTime = 1000000.0;
for (size_t samples = 0; samples < 32; ++samples) {
- fastos::StopWatch timer;
+ vespalib::Timer timer;
for (size_t n = 0; n < fork; ++n) {
threadBundle.run(targets);
}
- double time = timer.elapsed().ms();
+ double time = vespalib::count_ms(timer.elapsed());
if (time < minTime) {
minTime = time;
}
diff --git a/vespalib/src/tests/slime/summary-feature-benchmark/summary-feature-benchmark.cpp b/vespalib/src/tests/slime/summary-feature-benchmark/summary-feature-benchmark.cpp
index 61ba2593eb3..1d011e507bb 100644
--- a/vespalib/src/tests/slime/summary-feature-benchmark/summary-feature-benchmark.cpp
+++ b/vespalib/src/tests/slime/summary-feature-benchmark/summary-feature-benchmark.cpp
@@ -47,12 +47,12 @@ TEST_F("slime -> json speed", FeatureFixture()) {
double minTime = 1000000.0;
MyBuffer buffer;
for (size_t i = 0; i < 16; ++i) {
- fastos::StopWatch timer;
+ vespalib::Timer timer;
for (size_t j = 0; j < 256; ++j) {
buffer.used = 0;
slime::JsonFormat::encode(f1.slime, buffer, true);
}
- minTime = std::min(minTime, timer.elapsed().ms() / 256.0);
+ minTime = std::min(minTime, vespalib::count_ms(timer.elapsed()) / 256.0);
size = buffer.used;
}
fprintf(stderr, "time: %g ms (size: %zu bytes)\n", minTime, size);
@@ -63,12 +63,12 @@ TEST_F("slime -> binary speed", FeatureFixture()) {
double minTime = 1000000.0;
MyBuffer buffer;
for (size_t i = 0; i < 16; ++i) {
- fastos::StopWatch timer;
+ vespalib::Timer timer;
for (size_t j = 0; j < 256; ++j) {
buffer.used = 0;
slime::BinaryFormat::encode(f1.slime, buffer);
}
- minTime = std::min(minTime, timer.elapsed().ms() / 256.0);
+ minTime = std::min(minTime, vespalib::count_ms(timer.elapsed()) / 256.0);
size = buffer.used;
}
fprintf(stderr, "time: %g ms (size: %zu bytes)\n", minTime, size);