Compare commits

...

1 Commits

Author SHA1 Message Date
Ed Hennis
b19387d84b Number perf test
- Run the Number test suite 1000 times to allow for performance measurement
2026-04-29 10:44:17 -04:00

View File

@@ -1581,6 +1581,30 @@ public:
}
};
class NumberPerf_test : public Number_test
{
void
run() override
{
// This suite will give the most accurate results when run
// single threaded, suppressing non-log output.
// "--unittest=NumberPerf --quiet --unittest-log"
using clock_type = std::chrono::steady_clock;
int limit = 100000;
auto const start = clock_type::now();
for (int i = 0; i < limit; ++i)
{
Number_test::run();
}
auto const duration =
std::chrono::duration_cast<std::chrono::milliseconds>(clock_type::now() - start);
log << "Number test repeated " << limit << " times took " << duration << "\n";
}
};
BEAST_DEFINE_TESTSUITE(Number, basics, xrpl);
BEAST_DEFINE_TESTSUITE_MANUAL(NumberPerf, tx, xrpl);
} // namespace xrpl