|
CLASSpp Manual
Cosmology reference and developer manual
|
#include <algorithm>#include <chrono>#include <cmath>#include <cstdio>#include <cstdlib>#include <string>#include <vector>#include "cosmology.h"#include "input_module.h"Per-module timing harness for CLASS++.
Drives the lazy Cosmology pipeline one module at a time, timing each stage with a steady clock. Repeats the whole run N times (fresh Cosmology each loop) so we can report min / median / mean / stddev per module and judge which modules actually dominate the wall time – and whether a proposed optimization has any chance of moving the needle.
Usage: ./class_profiled <file.ini> [num_loops] (default num_loops = 5)
Timings are pure wall time of each GetXxxModule() call. Because the modules are memoized inside Cosmology and built in dependency order here, each call does only its own work.