bench - bench - Processing benchmark suites
This package provides commands for the execution of benchmarks written in the bench language, and for the processing of results generated by such execution.
A reader interested in the bench language itself should start with the bench language introduction and proceed from there to the formal bench language specification.
This command locates Tcl interpreters and returns a list containing their paths. It searches them in the list of paths specified by the caller, using the glob pattern.
The command resolves soft links to find the actual executables matching the pattern. Note that only interpreters which are marked as executable and are actually executable on the current platform are put into the result.
This command executes the benchmarks declared in the set of files, once per Tcl interpreter specified via the interp_list, and per the configuration specified by the options, and then returns the accumulated timing results. The format of this result is described in section Result format.
It is assumed that the contents of the files are written in the bench language.
The available options are
This command takes a list of Tcl interpreters, identified by their path, and returns a dictionary mapping from the interpreters to their versions. Interpreters which are not actually executable, or fail when interrogated, are not put into the result. I.e the result may contain less interpreters than there in the input list.
The command uses builtin command info patchlevel to determine the version of each interpreter.
This command removes a column, i.e. all benchmark results for a specific Tcl interpreter, from the specified benchmark result and returns the modified result.
The benchmark results are in the format described in section Result format.
The column is identified by an integer number.
This command renames a column in the specified benchmark result and returns the modified result. This means that the path of the Tcl interpreter in the identified column is changed to an arbitrary string.
The benchmark results are in the format described in section Result format.
The column is identified by an integer number.
This commands takes one or more benchmark results, merges them into one big result, and returns that as its result.
All benchmark results are in the format described in section Result format.
This command normalizes the timing results in the specified benchmark result and returns the modified result. This means that the cell values are not times anymore, but factors showing how much faster or slower the execution was relative to the baseline.
The baseline against which the command normalizes are the timing results in the chosen column. This means that after the normalization the values in this column are all 1, as these benchmarks are neither faster nor slower than the baseline.
A factor less than 1 indicates a benchmark which was faster than the baseline, whereas a factor greater than 1 indicates a slower execution.
The benchmark results are in the format described in section Result format.
The column is identified by an integer number.
This command formats the specified benchmark result for output to a file, socket, etc. This specific command does no formatting at all, it passes the input through unchanged.
For other formatting styles see the packages bench::out::text and bench::out::csv which provide commands to format benchmark results for human consumption, or as CSV data importable by spread sheets, respectively.
Complementary, to read benchmark results from files, sockets etc. look for the package bench::in and the commands provided by it.
After the execution of a set of benchmarks the raw result returned by this package is a Tcl dictionary containing all the relevant information. The dictionary is a compact representation, i.e. serialization, of a 2-dimensional table which has Tcl interpreters as columns and benchmarks as rows. The cells of the table contain the timing results. The Tcl interpreters / columns are identified by their paths. The benchmarks / rows are identified by their description.
The possible keys are all valid Tcl lists of two or three elements and have one of the following forms:
The set of keys matching this glob pattern capture the information about all the Tcl interpreters used to run the benchmarks. The second element of the key is the path to the interpreter.
The associated value is the version of the Tcl interpreter.
The set of keys matching this glob pattern capture the information about all the benchmarks found in the executed benchmark suite. The second element of the key is the description of the benchmark, which has to be unique.
The associated value is irrelevant, and set to the empty string.
The set of keys matching this glob pattern capture the performance information, i.e. timing results. The second element of the key is the description of the benchmark, the third element the path of the Tcl interpreter which was used to run it.
The associated value is either one of several special result codes, or the time it took to execute the benchmark, in microseconds. The possible special result codes are
Benchmark could not be executed, failed with a Tcl error.
The benchmark could be executed, however the result from its body did not match the declared expectations.
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category bench of the Tcllib Trackers. Please also report any ideas for enhancements you may have for either package and/or documentation.
bench_intro, bench_lang_intro, bench_lang_spec, bench_read, bench_wcsv, bench_wtext
Benchmark tools
Copyright © 2007-2008 Andreas Kupries <andreas_kupries@users.sourceforge.net>