Designed to benchmark performance of PCs/Laptops/WSL/etc when working on NodeJS-based Front-End projects.
sudo apt install python-is-python3
on WSL)pip
(sudo apt install python3-pip
on WSL)nodeenv
: pip install nodeenv
npm ci
to install depsconfig.example.ts
to config.ts
config.ts
to your liking (add projects, commands, optionally patches, etc.), see Configurationnpm start
(or npm start -- --run-indefinitely
)See results in CLI (mean ± standard deviation):
Benchmarking "build"...
Average: 10s ±132ms
Benchmarking "unit test"...
Average: 45s ±12s
and more details in results.json
file
--run-indefinitely
- when set, will re-run benchmarks for all projects until you stop the process manually (using Ctrl+C). Useful for when you can leave device running for long and want to get more precise benchmark results. Note: afterAll()
hooks won't run in this case, which might affect reporters
Available options:
name
: the name of your projectgitUrl
: URL of your Git repository to clone (make sure credentials are saved before running benchmarks)gitCliConfigOverrides
: key-value object, will be passed to git clone -c your=option -c another=option
to override global config options, such as autocrlf
, etc.rootFolder
: this is your NodeJS root folder (where the package.json
is). If you have multiple projects within the same repo - add multiple project entries with different root folderspatches
: optional array of patches to apply, requires name
and file
options, see patchingcommands
: an array of commands to be benchmarked, see commandsCommands are what being benchmarked, common examples: npm ci
, npm test
, npm run build
, etc.
Every command needs a name
.
Types of commands (only one per command):
npmScriptName
- will call npm run ${npmScriptName}
, for example npmScriptName: "build-dev"
npxCommand
- will call npx ${npxCommand}
, for example: npxCommand: "jest"
npmCommand
- will call npm ${npmCommand}
, for example: npmCommand: "ci"
Patching can be useful to disable certain tests, change scripts, engines, etc. It's run right after cloning, before installing nodeenv and npm modules.
Available patching options:
search: "find-me"
and replace: "replace-with-me"
- it'll replace first occurrencedelete: true
- will delete fileappend: "some-string"
- will append to fileNote: all patching options are exclusive
The system supports multiple reporters that extend Reporter
class.
Available reporters:
cli
- logs totals, averages and deviation to stdoutfs
- preserves reports into results.json
filechart
- saves visual representation in results.png
fileAll reporters have to implement collectResult()
method that is called after each command is benchmarked.
Some reporters may choose to implement afterAll()
method that is called after all benchmarks are done for all projects.
npx -y cross-env DEBUG=true npm start
and look in log.txt