Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions root/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#add_subdirectory(math)
add_subdirectory(io)
add_subdirectory(interpreter)
if (ROOT_roofit_FOUND)
add_subdirectory(roofit)
endif()
2 changes: 2 additions & 0 deletions root/interpreter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
RB_ADD_GBENCHMARK(InterpreterBenchmarks
RunInterpreter.cxx)
27 changes: 27 additions & 0 deletions root/interpreter/RunInterpreter.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include <iostream>
#include <cstdlib>
#include <string>

#include <unistd.h>

#include "benchmark/benchmark.h"

static int runTutorial(const std::string& dir, const std::string& filename) {
if (getenv("ROOTSYS") == nullptr) {
std::cerr << "Couldn't find ROOTSYS environment variable!\n";
exit(1);
}
std::string rootsys = getenv("ROOTSYS");
std::string fullpath = rootsys + "/" + dir + "/" + filename;
std::string rootInvocation = "root.exe -l -q -b -n -x \"" + fullpath + "\" -e return ";
return std::system(rootInvocation.c_str());
}

static void TestTutorial(benchmark::State &state, const char *dir, const char *tutorial) {
while (state.KeepRunning())
runTutorial(dir, tutorial);
}

BENCHMARK_CAPTURE(TestTutorial, Test_hsimple, "tutorials/", "hsimple.C")->Unit(benchmark::kMicrosecond);

BENCHMARK_MAIN();