As far as I can judge, the Perl script in the repo can be replaced by a fourteen-line POSIX shell script:
#!/bin/sh
# Run from the project root as:
#
# sh ./scripts/bench.sh
set -e -u
for f in $( ls -1 -A -q *.yml )
do
time -p semgrep -q -f "$f" . 2>&1\
| grep -F -e 'real'\
| awk -v f="$f" '{ printf("%s, %.3f\n", f, $2); }'
done
If you'd like. This was a hacky script I used when running some of my own tests. Feel free to generalize it (even replacing it with a Go program if you want ...)
As far as I can judge, the Perl script in the repo can be replaced by a fourteen-line POSIX shell script:
Example output:
I could also add some parameters, like making the pattern configurable to only check a subset of rules, if anyone needs that.
If you agree, I can send a PR.