Generate benchmarks for terminal emulators
Switch branches/tags
Nothing to show
Clone or download
chrisduerr and jwilm Update dependencies (#9)
This updates all dependencies. The main reason for this update is that
the recent `terminfo` version update to `0.6.1` resolves an issue with
looking up terminfo databases, where vtebench would panic unexpectedly
at startup.
Latest commit 50a0e4b Sep 20, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Label bottom of scroll region rows Jan 15, 2018
.gitignore Initial commit of vtebench Dec 25, 2017
Cargo.lock Update dependencies (#9) Sep 20, 2018
Cargo.toml Update dependencies (#9) Sep 20, 2018
LICENSE-APACHE Add license Dec 25, 2017
README.md Add guidance on --bytes flag Dec 25, 2017

README.md

vtebench

A tool for generating terminal benchmarks

Usage

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.

The -b|--bytes flag

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.

Contributing

If you wish to add a new test, do the following:

  1. Add a new function in bench.rs with the same pattern as an existing function.
  2. Add a subcommand to run it in the Benchmark enum within cli.rs.
  3. 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 terminfo crate's capability submodule documentation. Each capability name has a corresponding type in that submodule.