Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
escapeIdentifier
(version: 1)
Comparing performance of:
escapeIdentifierOld vs escapeIdentifierNew
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const escapeIdentifierOld = (str) => '"' + str.replaceAll('"', '""') + '"'; const escapeIdentifierNew = (str) => str.includes('"') ? '"' + str.replaceAll('"', '""') + '"' : str;
Tests:
escapeIdentifierOld
escapeIdentifierOld("aaaaaa") escapeIdentifierOld('aaa"aaa')
escapeIdentifierNew
escapeIdentifierNew("aaaaaa") escapeIdentifierNew('aaa"aaa')
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
escapeIdentifierOld
escapeIdentifierNew
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Browser/OS:
Chrome 133 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
escapeIdentifierOld
709570.7 Ops/sec
escapeIdentifierNew
1124904.4 Ops/sec
Related benchmarks:
Asterisk map replace vs regex replace
Triple replace instead of regex
string replaceAll test
sa sad test
escape and escapeAttr
escape and escapeAttr and escapeLoop 2
Regexp test for finding invalid character
Escape HTML regex vs replace vs textNode vs Option 4
rgx replace with if
Comments
Confirm delete:
Do you really want to delete benchmark?