A benchmark script for node-re2
You can run the benchmark script by the following commands.
$ docker pull vtiwamoto/node-re2-benchmark
$ docker run --rm --init vtiwamoto/node-re2-benchmark
[input]
pattern: ([a-z]+)+$
subject: aaaaaaaaaaaaaaaaaaaaaaaaaaaa!
[benchmark]
RE2: 0.192ms
RegExp: 5082.343ms
You can also pass a pattern and a subject.
$ docker run --rm --init vtiwamoto/node-re2-benchmark '(.*a){30}' 'aaaaaaaaaaaaaaaaaaaaaaaaaaaX'
[input]
pattern: (.*a){30}
subject: aaaaaaaaaaaaaaaaaaaaaaaaaaaX
[benchmark]
RE2: 0.308ms
RegExp: 4551.599ms