()
| 32 | const REV_LIST_REGEXP = /^([a-f0-9]+)\s*([a-f0-9]+)\s*([a-f0-9]+)?\s*$/; |
| 33 | |
| 34 | const checkV8Flags = () => { |
| 35 | const requiredFlags = getV8Flags().filter( |
| 36 | (flag) => !flag.startsWith("--max-old-space-size") |
| 37 | ); |
| 38 | const actualFlags = process.execArgv; |
| 39 | const missingFlags = requiredFlags.filter( |
| 40 | (flag) => !actualFlags.includes(flag) |
| 41 | ); |
| 42 | if (missingFlags.length > 0) { |
| 43 | // Missing flags invalidate deterministic benchmarking (hash/random seeds, |
| 44 | // GC scheduling, JIT). Throw instead of warning so CI and local runs can't |
| 45 | // silently produce unstable numbers — use `yarn benchmark` to run with |
| 46 | // the correct flags. |
| 47 | throw new Error( |
| 48 | `Missing required V8 flags for stable benchmarking: ${missingFlags.join( |
| 49 | ", " |
| 50 | )}\nRun via \`yarn benchmark\` so the flags declared in package.json are applied.` |
| 51 | ); |
| 52 | } |
| 53 | }; |
| 54 | |
| 55 | checkV8Flags(); |
| 56 |
no outgoing calls
no test coverage detected