Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Concat vs plus sign string vs string literals
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/140.0.0.0 Safari/537.36
Browser:
Chrome 140
Operating system:
Windows
Device Platform:
Desktop
Date tested:
7 months ago
Test name
Executions per second
Concat
22956.9 Ops/sec
+ sign
134976.7 Ops/sec
String Literals
27477.5 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const image = 'https://www.dell.com/images/global/navigation/navbar/delllogo.svg'; const prodname = 'Latitude'; const viewItemUrl = 'https://www.dell.com/en-us/shop/computing/latitude'; const rewardsTotalValue = '$1357.85'; const display = '$1557.85'; const a = 'goToCartElClass'; const r = 'rewardsTotalValue'; const isConfigurable = 'isConfigurable'; const description = 'lorem ipsum dolor sit amet consectetur adipiscing elit';
Tests:
Concat
const html = '\n <div class="tnt-dell-rewards-carousel-body-item">\n <div class="tnt-dell-rewards-carousel-body-item-image">\n <img src="'.concat(image,'" alt="').concat(prodname,'">\n </div>\n <div class="tnt-dell-rewards-carousel-body-item-info">\n <p class="tnt-dell-rewards-item-name"><a href="').concat(viewItemUrl,'" title="').concat(prodname,'">').concat(prodname,'</a></p>\n <p class="tnt-dell-rewards-item-value">after applying <b>').concat(rewardsTotalValue,'</b> Rewards when paying in checkout</p>\n </div>\n <div class="tnt-dell-rewards-carousel-body-item-price">\n <s>').concat(display,"</s>\n <b>").concat(a,'</b>\n </div>\n <div class="tnt-dell-rewards-carousel-body-item-buttons">\n <a href="//www.dell.com/purchase/cart/en-ca" class="').concat(r,'" title="Go to Cart">Go to Cart</a>\n <a href="').concat(viewItemUrl,'" class="tnt-dell-rewards-button-secondary tnt-dell-rewards-button-configurable-').concat(isConfigurable,'" title="Customize">Customize the ').concat(description&&description.slice(0,-1),"</a>\n </div>\n </div>\n "); document.body.insertAdjacentHTML('afterbegin', html);
+ sign
const html = '\n <div class="tnt-dell-rewards-carousel-body-item">\n <div class="tnt-dell-rewards-carousel-body-item-image">\n <img src="'+ image +'" alt="' + prodname +'">\n </div>\n <div class="tnt-dell-rewards-carousel-body-item-info">\n <p class="tnt-dell-rewards-item-name"><a href="'+viewItemUrl+'" title="'+prodname+'">'+prodname+'</a></p>\n <p class="tnt-dell-rewards-item-value">after applying <b>'+rewardsTotalValue+'</b> Rewards when paying in checkout</p>\n </div>\n <div class="tnt-dell-rewards-carousel-body-item-price">\n <s>'+display+"</s>\n <b>"+a+'</b>\n </div>\n <div class="tnt-dell-rewards-carousel-body-item-buttons">\n <a href="//www.dell.com/purchase/cart/en-ca" class="'+r+'" title="Go to Cart">Go to Cart</a>\n <a href="'+viewItemUrl+'" class="tnt-dell-rewards-button-secondary tnt-dell-rewards-button-configurable-'+isConfigurable+'" title="Customize">Customize the '+description&&description.slice(0,-1)+'</a>\n </div>\n </div>\n '; document.body.insertAdjacentHTML('afterbegin', html);
String Literals
const html = ` <div class="tnt-dell-rewards-carousel-body-item"> <div class="tnt-dell-rewards-carousel-body-item-image"> <img src="${image}" alt="${prodname}"> </div> <div class="tnt-dell-rewards-carousel-body-item-info"> <p class="tnt-dell-rewards-item-name"><a href="${viewItemUrl}" title="${prodname}">${prodname}</a></p> <p class="tnt-dell-rewards-item-value">after applying <b>${r}</b> Rewards when paying in checkout</p> </div> <div class="tnt-dell-rewards-carousel-body-item-price"> <s>${display}</s> <b>${rewardsTotalValue}</b> </div> <div class="tnt-dell-rewards-carousel-body-item-buttons"> <a href="//www.dell.com/purchase/cart/en-ca" class="${a}" title="Go to Cart">Go to Cart</a> <a href="${viewItemUrl}" class="tnt-dell-rewards-button-secondary tnt-dell-rewards-button-configurable-${isConfigurable}" title="Customize">Customize the ${description && description.slice(0, -1)}</a> </div> </div> `; document.body.insertAdjacentHTML('afterbegin', html);