A tool for generating terminal benchmarks
The general usage pattern is
vtebench -w $(tput cols) -h $(tput lines) [-c|-b=BYTES|-t=TERM] <benchmark>
Terminal protocol will be output to
stdout. Output must be directed into a
file rather than used directly to benchmark.
vtebench is written for ease of
understanding, not performance. To benchmark the currently running terminal
then, something like this would work:
vtebench -w $(tput cols) -h $(tput lines) alt-screen-random-write \ > /tmp/100mb.vte time cat /tmp/100mb.vte
In the future, it would be nice to have a script to automate generating all of the tests, running them several times and generate statistics, and print all the results in a machine+human friendly format.
It's important to generate sufficient output to test the terminal. If the test
only takes 1ms to complete, you lack statistical significance. As a guideline,
time cat <script> should take at least 1 second. How much data is needed to
get there will vary greatly by terminal.
If you wish to add a new test, do the following:
- Add a new function in bench.rs with the same pattern as an existing function.
- Add a subcommand to run it in the
Benchmarkenum within cli.rs.
- Handle the subcommand in main.rs.
If there are escape codes that are not yet supported on
Context it is quite
helpful to reference the
terminfo man page and cross reference with the
capability submodule documentation. Each capability
name has a corresponding type in that submodule.