Add benchmark scripts for no-IO (#1925)

This commit is contained in:
Charlie Marsh 2023-01-16 17:38:40 -05:00 committed by GitHub
parent f3bf008aed
commit 2ed1f78873
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 736 additions and 38 deletions

26
scripts/benchmarks/run_all.sh Executable file
View file

@ -0,0 +1,26 @@
#!/usr/bin/env sh
###
# Benchmark Ruff's performance against a variety of similar tools, suppressing output as much as
# possible (so as to reduce I/O overhead).
###
# Note: Flake8's `checker.py` requires the following variant of `mp_run`:
# def _mp_run(filename: str) -> tuple[str, Results, dict[str, int]]:
# try:
# return FileChecker(
# filename=filename, plugins=_mp_plugins, options=_mp_options
# ).run_checks()
# except:
# return (filename, [], {
# "files": 0,
# "logical lines": 0,
# "physical lines": 0,
# "tokens": 0,
# })
hyperfine --ignore-failure --warmup 5 \
"./target/release/ruff ./resources/test/cpython/ --no-cache --silent --select ALL" \
"flake8 resources/test/cpython -qq --docstring-convention=all" \
"pycodestyle resources/test/cpython -qq" \
"pylint resources/test/cpython -j 0 --recursive=y --disable=E,W,C,R"