Giter Club home page Giter Club logo

templ-benchmark's Introduction

Performance benchmark of native html/template and templ.

TLDR: Templ is way faster.

Run with

$ make bench

$ make bench count=22

Results

goos: linux
goarch: amd64
pkg: templ-benchmark
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
         │    templ     │                  native                  │
         │    sec/op    │     sec/op      vs base                  │
Hello-8    174.7n ± 48%     971.6n ± 58%   +456.31% (p=0.000 n=10)
Table-8    740.9µ ±  4%   11551.7µ ± 33%  +1459.07% (p=0.000 n=10)
Layout-8   752.2µ ± 11%   11544.0µ ± 31%  +1434.61% (p=0.000 n=10)
geomean    46.00µ           506.0µ        +1000.00%

         │    templ     │                native                │
         │     B/op     │     B/op      vs base                │
Hello-8      200.0 ± 0%     368.0 ± 0%  +84.00% (p=0.000 n=10)
Table-8    2.643Mi ± 0%   4.835Mi ± 0%  +82.92% (p=0.000 n=10)
Layout-8   2.643Mi ± 0%   4.830Mi ± 0%  +82.73% (p=0.000 n=10)
geomean    112.7Ki        206.5Ki       +83.22%

         │    templ    │                 native                 │
         │  allocs/op  │  allocs/op    vs base                  │
Hello-8     5.000 ± 0%    13.000 ± 0%   +160.00% (p=0.000 n=10)
Table-8    2.018k ± 0%   56.781k ± 0%  +2713.73% (p=0.000 n=10)
Layout-8   2.017k ± 0%   56.780k ± 0%  +2715.07% (p=0.000 n=10)
geomean     273.0         3.474k       +1172.28%

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.