Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Excel content type using RegEx vs direct comparison
(version: 1)
Comparing performance of:
RegEx vs Direct comparison
Created:
8 months ago
by:
Guest
Go to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const regex = /sheet|excel|spreadsheet|officedocument/i function compare(mime) { return mime == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }
Tests:
RegEx
regex.test('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') regex.test('text/html')
Direct comparison
compare('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') compare('text/html')
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
RegEx
Direct comparison
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
8 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 Edg/142.0.0.0
Browser/OS:
Chrome 142 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Direct comparison
55.8M/s
RegEx
7.0M/s
View exact numbers
Test name
Executions per second
✓
Direct comparison
55,826,100 Ops/sec
RegEx
6,986,259 Ops/sec
Related benchmarks
Javascript: Case insensitive string comparison
startsWith or regex test or indexOf
Comments
Confirm delete:
Do you really want to delete benchmark?