CLI Reference (Automated)

This is a automatically written CLI Reference. It has exactly the same content as the --help parameter. There also exists a hand-written CLI Reference at CLI Reference. This automated one is given because the hand-written one can be outdated sometimes. The hand-written one is better than this so you should try to use that over this whenever you can

This version does not have many examples. For examples see the hand-written version

fastero

Benchmark each snippet in CODE_SNIPPETS.

Detailed documentation available at https://fastero.readthedocs.io

Usage

fastero [OPTIONS] [CODE_SNIPPETS]...

Options

-n, --snippet-name <NAME>

Give a meaningful name to a snippet. This can be specified multiple times if several snippets are benchmarked.

-s, --setup <STMT>

Code to be executed once in each batch . Execution time of this setup code is not timed

Default:

'pass'

-f, --from-json <FILE>

If used, get all the parameters from FILE. The file needs to be a json file with a schema simillar to exported json files

-j, --json

If used, output results in a json format to stdout.

-q, --quiet

If used, there will be no output printed.

-e, --only-export

If used alongside --from-json, skips the benchmarking part and just exports the data.

-w, --warmup <NUM>

Perform NUM warmup runs before the actual benchmark. Perform this only for presistent improvements. Otherwise all performance gains are lost on each batch

-c, --code-theme <THEME_NAME>

Theme for code input and output, also applicable if “-” is used for any of the parameters, For a list see https://pygments.org/styles

Default:

'one-dark'

-t, --total-time <TIME>

How long to test each snippet for, specifying --runs overrides this. Format: 500ms, 10s, 1m5s, 1.5m, 1h30m15s, etc.

Default:

'3s'

-b, --time-per-batch <TIME>

How long each test batch will last for, increase this to make the tests more accurate at the cost of making progress bar less smooth. Also change --total-time accordingly or else statistics won’t work

Default:

'200ms'

-u, --time-unit <UNIT>

Set the time unit to be used. Possible values: ns, us, ms, s, dynamic

Default:

'dynamic'

Options:

ns | us | ms | s | dynamic

-r, --runs <NUM>

Perform exactly NUM runs for each snippet. By default, the number of runs is automatically determined

-m, --min-runs <NUM>

Perform at least NUM runs for each snippet

Default:

2

-M, --max-runs <NUM>

Perform at least NUM runs for each snippet, by default unlimited.

--export-json <FILE>

Export the timing summary statistics as JSON to the given FILE

--export-csv <FILE>

Export the timing summary statistics as CSV to the given FILE.

--export-yaml <FILE>

Export the timing summary statistics as YAML to the given FILE.

--export-markdown <FILE>

Export the timing summary statistics as a Markdown table to the given FILE.

--export-svg <FILE>

Export the console output as a svg image to the given FILE

--export-image <FILE>

Export the console output as an image to the given FILE. Exports to svg then uses a headless browser to screenshot that svg output.

--background <CSS_COLOR>

Specify a custom background for the generated image. This supports anything the CSS background property supports including images, gradients etc. For more info see https://www.w3schools.com/cssref/css3_pr_background.asp

Default:

'random'

--selenium-browser <BROWSER>

The browser to use for exporting the image

Default:

'chrome'

Options:

chrome | edge | firefox | opera | safari

--watermark, --no-watermark

Whether to add a watermark to the bottom right corner of the generated image. A watermark helps spread the word

Default:

True

--export-asciidoc <FILE>

Export the timing summary statistics as an AsciiDoc table to the given FILE.

--export-plot <FILE>

Export the timing summary statistics as a image of a bar plot to the given FILE

--label-format <FORMAT>

Format string for the bar plot, only applicable if the --export-plot option is specified.

Default:

'{snippet_name}\\\\n{snippet_code}'

--dark-background

If used, the plot background will be in dark mode instead of light

Default:

False

--bar-color <MATPLOTLIB_COLOR>

A color to use for the bars in the bar plot. Must be in matplotlib supported format, For more info see https://matplotlib.org/stable/tutorials/colors/colors.html

Default:

'#99bc5a'

--export-html <FILE>

Export the timing summary statistics as html web page to the given FILE

-v, --version

Show the version and exit.

-h, --help

Show this message and exit.

Arguments

CODE_SNIPPETS

Optional argument(s)