Regexp - specific vs fuzzy

Benchmark created on


Setup

const strings = 
	[
	  'http://google.com',
	  'http://boogle.com'
	]
	
const specific = /http:\/\/(google|boogle)\.com/;
const fuzzyW = /http:\/\/(\w+)\.com/
const fuzzyA = /http:\/\/(.+)\.com/

Test runner

Ready to run.

Testing in
TestOps/sec
Specific
strings.forEach(string => {
  string.replace(specific, (a,s) => console.log(s));
})
ready
Fuzzy \w
strings.forEach(string => {
  string.replace(fuzzyW, (a,s) => console.log(s));
})
ready
Fuzzy *
strings.forEach(string => {
  string.replace(fuzzyA, (a,s) => console.log(s));
})
ready

Revisions

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