diff options
Diffstat (limited to 'benchmark/ci-helper.js')
-rw-r--r-- | benchmark/ci-helper.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/benchmark/ci-helper.js b/benchmark/ci-helper.js new file mode 100644 index 000000000..2dbdf5acf --- /dev/null +++ b/benchmark/ci-helper.js @@ -0,0 +1,13 @@ +// This script helps extract the benchmark logs that are between the `==========` lines. +// They are a convention defined in the `./bench/_template.js` file, which are used to log +// out with the `!bench` command. See `/.github/workflows/benchmark.yml` to see how it's used. +const benchLogs = process.argv[2]; +const resultRegex = /==========(.*?)==========/gs; + +let processedLog = ''; +let m; +while ((m = resultRegex.exec(benchLogs))) { + processedLog += m[1] + '\n'; +} + +console.log(processedLog); |