Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
JS > exec vs matchAll vs match
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36
Browser:
Chrome 144
Operating system:
Windows
Device Platform:
Desktop
Date tested:
6 months ago
1111
30.8M/s
2222
24.2M/s
3333
2.7M/s
View exact numbers
Test name
Executions per second
✓
1111
30,817,886 Ops/sec
2222
24,201,756 Ops/sec
3333
2,714,295 Ops/sec
Tests:
1111
const TAG_REGEX = /(\w+)/g; const dirtyHtml = 'aqui é uma <strong class="elm">questão</strong> de teste <img class="elm" onerror="opa"></img><br class="elm"/><iframe src="http://" class="iframeclass"/><iframe src="http://" class="iframeclass"/><iframe src="http://" class="iframeclass"/>'; TAG_REGEX.exec(dirtyHtml)
2222
const TAG_REGEX = /(\w+)/g; const dirtyHtml = 'aqui é uma <strong class="elm">questão</strong> de teste <img class="elm" onerror="opa"></img><br class="elm"/><iframe src="http://" class="iframeclass"/><iframe src="http://" class="iframeclass"/><iframe src="http://" class="iframeclass"/>'; dirtyHtml.matchAll(TAG_REGEX)
3333
const TAG_REGEX = /(\w+)/g; const dirtyHtml = 'aqui é uma <strong class="elm">questão</strong> de teste <img class="elm" onerror="opa"></img><br class="elm"/><iframe src="http://" class="iframeclass"/><iframe src="http://" class="iframeclass"/><iframe src="http://" class="iframeclass"/>'; dirtyHtml.match(TAG_REGEX)