Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
string cast vs template literal cast
cast to string or template literal wrapping
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 140
Operating system:
Android
Device Platform:
Mobile
Date tested:
7 months ago
Test name
Executions per second
String literal
45725516.0 Ops/sec
Template literal
48813832.0 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
/*your preparation JavaScript code goes here To execute async code during the script preparation, wrap it as function globalMeasureThatScriptPrepareFunction, example:*/ async function globalMeasureThatScriptPrepareFunction() { // This function is optional, feel free to remove it. // await someThing(); } const TEST_ITERATIONS=100000;
Tests:
String literal
/*When writing async/deferred tests, use `deferred.resolve()` to mark test as done*/ for (let i=0; i++; i<TEST_ITERATIONS) { const stringLiteral = String(i); }
Template literal
for (let i=0; i++; i<TEST_ITERATIONS) { const templateLiteral = `${i}` }