From 4f521c78965f38dd2bc305d3a013deff3c69e338 Mon Sep 17 00:00:00 2001 From: Weijia Wang <381152119@qq.com> Date: Wed, 31 Jan 2018 17:57:05 +0800 Subject: [PATCH] doc: add introduce about cli options PR-URL: https://github.com/nodejs/node/pull/18475 Reviewed-By: Jeremiah Senkpiel Reviewed-By: James M Snell --- doc/guides/writing-and-running-benchmarks.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/guides/writing-and-running-benchmarks.md b/doc/guides/writing-and-running-benchmarks.md index 22e235df323d52..66b5072a4979d7 100644 --- a/doc/guides/writing-and-running-benchmarks.md +++ b/doc/guides/writing-and-running-benchmarks.md @@ -184,6 +184,17 @@ The `compare.js` tool will then produce a csv file with the benchmark results. $ node benchmark/compare.js --old ./node-master --new ./node-pr-5134 string_decoder > compare-pr-5134.csv ``` +*Tips: there are some useful options of `benchmark/compare.js`. For example, if you want to compare the benchmark of a single script instead of a whole module, you can use the `--filter` option:* + +```console + --new ./new-node-binary new node binary (required) + --old ./old-node-binary old node binary (required) + --runs 30 number of samples + --filter pattern string to filter benchmark scripts + --set variable=value set benchmark variable (can be repeated) + --no-progress don't show benchmark progress indicator +``` + For analysing the benchmark results use the `compare.R` tool. ```console