KiCad PCB EDA Suite
|
#include <wx/wx.h>
#include <richio.h>
#include <chrono>
#include <ios>
#include <functional>
#include <iostream>
#include <fstream>
#include <wx/wfstream.h>
#include <wx/filename.h>
#include <qa_utils/stdstream_line_reader.h>
#include <qa_utils/utility_registry.h>
Go to the source code of this file.
Classes | |
struct | BENCH_REPORT |
struct | BENCHMARK |
Typedefs | |
using | CLOCK = std::chrono::steady_clock |
using | TIME_PT = std::chrono::time_point< CLOCK > |
using | BENCH_FUNC = std::function< void(const wxFileName &, int, BENCH_REPORT &)> |
Functions | |
static void | bench_fstream (const wxFileName &aFile, int aReps, BENCH_REPORT &report) |
Benchmark using a raw std::ifstream, with no LINE_READER wrapper. | |
static void | bench_fstream_reuse (const wxFileName &aFile, int aReps, BENCH_REPORT &report) |
Benchmark using a raw std::ifstream, with no LINE_READER wrapper. | |
template<typename LR > | |
static void | bench_line_reader (const wxFileName &aFile, int aReps, BENCH_REPORT &report) |
Benchmark using a given LINE_READER implementation. | |
template<typename LR > | |
static void | bench_line_reader_reuse (const wxFileName &aFile, int aReps, BENCH_REPORT &report) |
Benchmark using a given LINE_READER implementation. | |
static void | bench_string_lr (const wxFileName &aFile, int aReps, BENCH_REPORT &report) |
Benchmark using STRING_LINE_READER on string data read into memory from a file using std::ifstream, but read the data fresh from the file each time. | |
static void | bench_string_lr_reuse (const wxFileName &aFile, int aReps, BENCH_REPORT &report) |
Benchmark using STRING_LINE_READER on string data read into memory from a file using std::ifstream. | |
template<typename S > | |
static void | bench_wxis (const wxFileName &aFile, int aReps, BENCH_REPORT &report) |
Benchmark using an INPUTSTREAM_LINE_READER with a given wxInputStream implementation. | |
template<typename S > | |
static void | bench_wxis_reuse (const wxFileName &aFile, int aReps, BENCH_REPORT &report) |
Benchmark using an INPUTSTREAM_LINE_READER with a given wxInputStream implementation. | |
template<typename WXIS > | |
static void | bench_wxbis (const wxFileName &aFile, int aReps, BENCH_REPORT &report) |
Benchmark using a INPUTSTREAM_LINE_READER with a given wxInputStream implementation, buffered with wxBufferedInputStream. | |
template<typename WXIS > | |
static void | bench_wxbis_reuse (const wxFileName &aFile, int aReps, BENCH_REPORT &report) |
Benchmark using a INPUTSTREAM_LINE_READER with a given wxInputStream implementation, buffered with wxBufferedInputStream. | |
static wxString | getBenchFlags () |
Construct string of all flags used for specifying benchmarks on the command line. | |
static wxString | getBenchDescriptions () |
Usage description of a benchmakr spec. | |
BENCH_REPORT | executeBenchMark (const BENCHMARK &aBenchmark, int aReps, const wxFileName &aFilename) |
int | io_benchmark_func (int argc, char *argv[]) |
Variables | |
static std::vector< BENCHMARK > | benchmarkList |
List of available benchmarks. | |
static bool | registered |
using BENCH_FUNC = std::function<void(const wxFileName&, int, BENCH_REPORT&)> |
Definition at line 60 of file io_benchmark.cpp.
using CLOCK = std::chrono::steady_clock |
Definition at line 41 of file io_benchmark.cpp.
Definition at line 42 of file io_benchmark.cpp.
|
static |
Benchmark using a raw std::ifstream, with no LINE_READER wrapper.
The stream is recreated for each cycle.
Definition at line 75 of file io_benchmark.cpp.
References BENCH_REPORT::charAcc, and BENCH_REPORT::linesRead.
|
static |
Benchmark using a raw std::ifstream, with no LINE_READER wrapper.
The stream is not recreated for each cycle, just reset.
Definition at line 98 of file io_benchmark.cpp.
References BENCH_REPORT::charAcc, and BENCH_REPORT::linesRead.
|
static |
Benchmark using a given LINE_READER implementation.
The LINE_READER is recreated for each cycle.
Definition at line 123 of file io_benchmark.cpp.
References BENCH_REPORT::charAcc, BENCH_REPORT::linesRead, and LR.
|
static |
Benchmark using a given LINE_READER implementation.
The LINE_READER is rewound for each cycle, not recreated.
Definition at line 142 of file io_benchmark.cpp.
References BENCH_REPORT::charAcc, BENCH_REPORT::linesRead, and LR.
|
static |
Benchmark using STRING_LINE_READER on string data read into memory from a file using std::ifstream, but read the data fresh from the file each time.
Definition at line 163 of file io_benchmark.cpp.
References BENCH_REPORT::charAcc, LINE_READER::Line(), BENCH_REPORT::linesRead, and STRING_LINE_READER::ReadLine().
|
static |
Benchmark using STRING_LINE_READER on string data read into memory from a file using std::ifstream.
The STRING_LINE_READER is not reused (it cannot be rewound), but the file is read only once
Definition at line 188 of file io_benchmark.cpp.
References BENCH_REPORT::charAcc, LINE_READER::Line(), BENCH_REPORT::linesRead, and STRING_LINE_READER::ReadLine().
|
static |
Benchmark using a INPUTSTREAM_LINE_READER with a given wxInputStream implementation, buffered with wxBufferedInputStream.
The wxInputStream is recreated for each cycle.
Definition at line 261 of file io_benchmark.cpp.
References BENCH_REPORT::charAcc, LINE_READER::Line(), BENCH_REPORT::linesRead, and INPUTSTREAM_LINE_READER::ReadLine().
|
static |
Benchmark using a INPUTSTREAM_LINE_READER with a given wxInputStream implementation, buffered with wxBufferedInputStream.
The wxInputStream is reset for each cycle.
Definition at line 287 of file io_benchmark.cpp.
References BENCH_REPORT::charAcc, LINE_READER::Line(), BENCH_REPORT::linesRead, and INPUTSTREAM_LINE_READER::ReadLine().
|
static |
Benchmark using an INPUTSTREAM_LINE_READER with a given wxInputStream implementation.
The wxInputStream is recreated for each cycle.
Definition at line 212 of file io_benchmark.cpp.
References BENCH_REPORT::charAcc, LINE_READER::Line(), BENCH_REPORT::linesRead, and INPUTSTREAM_LINE_READER::ReadLine().
|
static |
Benchmark using an INPUTSTREAM_LINE_READER with a given wxInputStream implementation.
The wxInputStream is reset for each cycle.
Definition at line 237 of file io_benchmark.cpp.
References BENCH_REPORT::charAcc, LINE_READER::Line(), BENCH_REPORT::linesRead, and INPUTSTREAM_LINE_READER::ReadLine().
BENCH_REPORT executeBenchMark | ( | const BENCHMARK & | aBenchmark, |
int | aReps, | ||
const wxFileName & | aFilename | ||
) |
Definition at line 363 of file io_benchmark.cpp.
References BENCH_REPORT::benchDurMs, and BENCHMARK::func.
Referenced by io_benchmark_func().
|
static |
Usage description of a benchmakr spec.
Definition at line 350 of file io_benchmark.cpp.
References benchmarkList.
Referenced by io_benchmark_func().
|
static |
Construct string of all flags used for specifying benchmarks on the command line.
Definition at line 334 of file io_benchmark.cpp.
References benchmarkList.
Referenced by io_benchmark_func().
int io_benchmark_func | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 381 of file io_benchmark.cpp.
References KI_TEST::BAD_CMDLINE, BENCH_REPORT::benchDurMs, benchmarkList, BENCH_REPORT::charAcc, executeBenchMark(), getBenchDescriptions(), getBenchFlags(), BENCH_REPORT::linesRead, and KI_TEST::OK.
|
static |
List of available benchmarks.
Definition at line 309 of file io_benchmark.cpp.
Referenced by getBenchDescriptions(), getBenchFlags(), and io_benchmark_func().
|
static |
Definition at line 425 of file io_benchmark.cpp.