Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Lodash template VS JS Replace
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/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Lodash template
22662.5 Ops/sec
JS Replace
1235776.9 Ops/sec
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js'></script>
Script Preparation code:
var testString = 'We demystify ${variable1} porn and ${variable2} alternative sexuality ${variable3} authentic kinky porn and bondage videos. Experience the other side of porn with Kink.' var params = { variable1: 'value1', variable2: 'value2', variable3: 'value3' };
Tests:
Lodash template
_.template(testString)(params);
JS Replace
let replaced = testString; Object.keys(params).forEach(key => { replaced = replaced.replaceAll(`\$\{${key}\}`, params[key]); });