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; rv:140.0) Gecko/20100101 Firefox/140.0
Browser:
Firefox 140
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
11 months ago
Test name
Executions per second
Lodash template
45754.1 Ops/sec
JS Replace
1421552.4 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]); });