Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Complex concatenation vs interpolation
(version: 1)
Comparing performance of:
Concatenation vs Interpolation
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
let string = ''
Tests:
Concatenation
string += 'SPACE' + 'quantity' + 'SPACE'; const priceString = 'SPACE' + 'price' + 'SPACE'; string += priceString + 'formatPriceFn(current.inclVat)' + '. '; string += ` ${'text.original'} ${'formatPriceFn(regular.inclVat)'}. `; string += ` ${'text.previousLowestPrice'} ${'formatPriceFn(lowestPrevious?.inclVat)'}`; string += 'getLowestPreviousPriceDisplayDate(text, lowestPreviousDate)'; string += '. ';
Interpolation
string = `${'SPACE'}${'quantity'}${'SPACE'}`; const priceString = `${'SPACE'}${'price'}${'SPACE'}`; string += `${priceString}${'formatPriceFn(current.inclVat)'}. `; string += ` ${'text.original'} ${'formatPriceFn(regular.inclVat)'}. ${'text.previousLowestPrice'} ${'formatPriceFn(lowestPrevious?.inclVat)'} ${'getLowestPreviousPriceDisplayDate(text, lowestPreviousDate)'} ${'. '}`;
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Concatenation
Interpolation
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Comments
Confirm delete:
Do you really want to delete benchmark?