File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 99 *
1010 * For regression testing of constraint systems (CS) and zkApps,
1111 * see {@link tests/perf-regression/perf-regression.ts}.
12+ *
13+ * @note
14+ * Command-line arguments:
15+ * - `--dump` (alias `-d`): dump performance data into the baseline file.
16+ * - `--check` (alias `-c`): check performance against the existing baseline.
17+ * - `--file` (alias `-f`): specify a custom JSON path (default: `./tests/perf-regression/perf-regression.json`).
18+ * - `--silent`: suppress all console output.
19+ *
20+ * These flags are mutually exclusive for modes (`--dump` and `--check` cannot be used together).
21+ * When neither is provided, the script runs in log-only mode.
1222 */
1323
1424import { ConstraintSystemSummary } from '../provable/core/provable-context.js' ;
@@ -44,13 +54,23 @@ type PerfStack = {
4454const argv = minimist ( process . argv . slice ( 2 ) , {
4555 boolean : [ 'dump' , 'check' , 'silent' ] ,
4656 string : [ 'file' ] ,
47- alias : { f : 'file' } ,
57+ alias : {
58+ f : 'file' ,
59+ d : 'dump' ,
60+ c : 'check' ,
61+ } ,
4862} ) ;
4963
5064const DUMP = Boolean ( argv . dump ) ;
5165const CHECK = Boolean ( argv . check ) ;
5266const SILENT = Boolean ( argv . silent ) ;
5367
68+ // Cannot use both dump and check
69+ if ( DUMP && CHECK ) {
70+ console . error ( 'Error: You cannot use both --dump and --check at the same time!' ) ;
71+ process . exit ( 1 ) ;
72+ }
73+
5474const FILE_PATH = path . isAbsolute ( argv . file ?? '' )
5575 ? argv . file
5676 : path . join (
You can’t perform that action at this time.
0 commit comments