MQLArticles/Utils/MBen
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-06 11:15:27 -05:00
..
MultiBen.mqh new files added 2026-08-28 17:55:58 -05:00
README.md new files added 2026-09-06 11:15:27 -05:00
sql_init.sql new files added 2026-08-28 10:22:07 -05:00
sql_insert.sql new files added 2026-08-28 10:22:07 -05:00

← Utils

Utils/MBen

Benchmarking helper for timing multiple code blocks/operations and persisting the results to a local SQLite database for later comparison.

Main features

  • Accumulate timing samples per operation/dataset in memory (CMultiBenchmark::Add).
  • Flush all accumulated samples to a local SQLite database, creating the table if needed (CMultiBenchmark::Finish).
  • Parse a previously generated .log file (with a [MultiBen& tagging convention) and flush its results to the database as well (CMultiBenchmark::ParseLogFileTodayFlushDb).

Basic usage

CMultiBenchmark::Add("parse_json", "dataset_1000", 1, elapsed_microseconds);
// ... repeat Add() for each iteration/operation ...
CMultiBenchmark::Finish("benchmarks.sqlite", TimeToString(TimeLocal(), TIME_DATE), "MyLib");

Only the most representative methods are shown here.