Created
August 1, 2022 23:19
-
-
Save batiati/67abc02c1a3485a6ca6e80fdf0b93d96 to your computer and use it in GitHub Desktop.
Simple benchmark for mustache templates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { run, bench } from "mitata"; | |
import Mustache from "mustache"; | |
var template = "<title>{{title}}</title><h1>{{ title }}</h1><div>{{{body}}}</div>"; | |
Mustache.parse(template); | |
var data = { | |
title: "Hello, Mustache!", | |
body: "This is a really simple test of the rendering!", | |
}; | |
bench("simple template", ()=> | |
{ | |
var text = Mustache.render(template, data); | |
}); | |
await run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment