Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
mustache vs replace
(version: 1)
Comparing performance of:
mustache vs non mustache
Created:
5 years ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<script src='https://cdn.jsdelivr.net/combine/npm/mustache@4.0.1,npm/mustache@4.0.1/mustache.min.js'></script>
Tests:
mustache
const messageId = "hello {{planet}} what a {{weather}} day is in {{country}} today!"; const parameters = [{"planet": "earth"}, {"weather": "sunny"}, {"country":"Scotland"}]; console.log(Mustache.render(messageId,parameters));
non mustache
const messageId = "hello {{planet}} what a {{weather}} day is in {{country}} today!"; const parameters = [{"planet": "earth"}, {"weather": "sunny"}, {"country":"Scotland"}]; console.log(messageId ? Object.entries(parameters).reduce( (res, [key, value]) => res.replace(new RegExp(`{{\\s*${key}\\s*}}`, "g"), value), messageId ) : "");
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
mustache
non mustache
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Browser/OS:
Chrome 133 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
mustache
573413.2 Ops/sec
non mustache
517831.3 Ops/sec
Related benchmarks:
trim vs replace
Dompurify 2.3.3 vs sanitize-html 1.27.5 vs Js-XSS Latest (Test #1)
sanitize-html vs lodash
object spread vs immutable-js setIn vs mori hashmap vs immer
mustache@4.2.0 vs handlebars@4.7.8
Comments
Confirm delete:
Do you really want to delete benchmark?