MCPcopy Create free account
hub / github.com/catboost/catboost / SpeedBenchmark

Function SpeedBenchmark

library/cpp/linear_regression/benchmark/main.cpp:70–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68
69template <typename TLRSolver>
70void SpeedBenchmark(const TPool& originalPool) {
71 TDeviationCalculator speedTest;
72
73 static const size_t runsCount = 1000;
74 for (size_t runNumber = 0; runNumber < runsCount; ++runNumber) {
75 TLRSolver solver;
76 TLinearModel model;
77 {
78 TSimpleTimer timer;
79 for (const TInstance& instance : originalPool) {
80 solver.Add(instance.Features, instance.Goal, instance.Weight);
81 }
82 model = solver.Solve();
83
84 speedTest.Add(timer.Get().MicroSeconds());
85 }
86 }
87
88 const double multiplier = 1e-6;
89 Cout << Sprintf("%.5lf +/- %.5lf: ", speedTest.GetMean() * multiplier, speedTest.GetStdDev() * multiplier) << TypeName<TLRSolver>() << Endl;
90}
91
92int main(int argc, const char** argv) {
93 for (int taskNumber = 1; taskNumber < argc; ++taskNumber) {

Callers

nothing calls this directly

Calls 7

SprintfFunction · 0.85
GetMeanMethod · 0.80
GetStdDevMethod · 0.80
AddMethod · 0.45
SolveMethod · 0.45
MicroSecondsMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected