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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
Browser:
Chrome 122
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
Lodash template
61670.6 Ops/sec
JS Replace
1478776.6 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]); });