global vs local regexp

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
global
const re = new RegExp('^pg-functions:\/\/postgres(\/[a-zA-Z_][a-zA-Z0-9_]{0,62}){2}$')

for (let i = 0; i < 1_000_000; i++) {
  re.test('pg-functions://postgres/schema/function_name');
  re.test('pg-functions:///function_name');
}
ready
local
for (let i = 0; i < 1_000_000; i++) {
  /^pg-functions:\/\/postgres(\/[a-zA-Z_][a-zA-Z0-9_]{0,62}){2}$/.test('pg-functions://postgres/schema/function_name');
  /^pg-functions:\/\/postgres(\/[a-zA-Z_][a-zA-Z0-9_]{0,62}){2}$/.test('pg-functions:///function_name');
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.