Skip to content

Instantly share code, notes, and snippets.

@batiati
Created August 1, 2022 23:19
Show Gist options
  • Save batiati/67abc02c1a3485a6ca6e80fdf0b93d96 to your computer and use it in GitHub Desktop.
Save batiati/67abc02c1a3485a6ca6e80fdf0b93d96 to your computer and use it in GitHub Desktop.
Simple benchmark for mustache templates
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