comparing the performance of different template engines

goTemplateBenchmark

comparing the performance of different template engines

full featured template engines

precompilation to Go code

special benchmarks for comparison

  • Go text/template (do not use this for HTML)
  • StaticString - Use one static string for the whole Template to have a base time
  • DirectBuffer - Use go to write the HTML by hand to the buffer

transpiling to Go Template

  • Damsel I won't benchmark transpiling engines, because transpilation should just happen once at startup. If you cache the transpilation result, which is recommended, you would have the same performance numbers as html/template for rendering.

Why?

Just for fun. Go Templates work nice out of the box and should be used for rendering from a security point of view. If you care about performance you should cache the rendered output.

Sometimes there are templates that cannot be reasonably cached. Then you possibly need a really fast template engine with code generation.

Results dev machine

local desktop: ryzen 3900x

Changes with 1.15

  • benchmarks run on a new system. I ran 1.14.13 and 1.15.5 on the same machine.

Changes with 1.14

  • quite a few slowdowns, but I did not do any profiling. needs more testing.

Changes with 1.11

  • Pongo and Soy got about 25% improved

Changes with 1.9

There are quite some impressive performance improvements. Almost all pre compilation engines gained 10%-20%.

special benchmarks

Name Runs ns/op B/op allocations/op
ComplexGoDirectBuffer 7,715,667 456 0 0
ComplexGoStaticString 296,467,746 12 0 0
comparing: go1.15.8 to go version go1.16 linux/amd64
name                      old time/op    new time/op    delta
ComplexGoDirectBuffer-24     472ns ± 0%     456ns ± 0%  -3.45%
ComplexGoStaticString-24    12.4ns ± 0%    11.7ns ± 0%  -5.65%

name                      old alloc/op   new alloc/op   delta
ComplexGoDirectBuffer-24     0.00B          0.00B        0.00%
ComplexGoStaticString-24     0.00B          0.00B        0.00%

name                      old allocs/op  new allocs/op  delta
ComplexGoDirectBuffer-24      0.00           0.00        0.00%
ComplexGoStaticString-24      0.00           0.00        0.00%

simple benchmarks

full featured template engines

Name Runs µs/op B/op allocations/op
Ace 287,395 12.796 1,249 40
Amber 461,578 8.303 977 36
Golang 466,560 7.928 897 35
GolangText 1,460,233 2.582 128 7
Handlebars 269,463 14.150 3,967 78
JetHTML 3,455,011 1.008 0 0
Mustache 834,798 4.270 1,530 29
Pongo2 589,389 5.933 2,074 32
Soy 929,354 3.935 1,320 20
comparing: go1.15.8 to go version go1.16 linux/amd64
name           old time/op    new time/op    delta
Golang-24        8.19µs ± 0%    7.93µs ± 0%   -3.14%
GolangText-24    2.54µs ± 0%    2.58µs ± 0%   +1.49%
Ace-24           13.0µs ± 0%    12.8µs ± 0%   -1.39%
Amber-24         8.62µs ± 0%    8.30µs ± 0%   -3.63%
Mustache-24      4.16µs ± 0%    4.27µs ± 0%   +2.74%
Pongo2-24        5.79µs ± 0%    5.93µs ± 0%   +2.40%
Handlebars-24    13.9µs ± 0%    14.2µs ± 0%   +1.67%
Soy-24           3.93µs ± 0%    3.93µs ± 0%   +0.20%
JetHTML-24       0.99µs ± 0%    1.01µs ± 0%   +1.31%

name           old alloc/op   new alloc/op   delta
Golang-24        1.02kB ± 0%    0.90kB ± 0%  -12.49%
GolangText-24      128B ± 0%      128B ± 0%    0.00%
Ace-24           1.38kB ± 0%    1.25kB ± 0%   -9.36%
Amber-24         1.10kB ± 0%    0.98kB ± 0%  -11.58%
Mustache-24      1.57kB ± 0%    1.53kB ± 0%   -2.55%
Pongo2-24        2.07kB ± 0%    2.07kB ± 0%    0.00%
Handlebars-24    3.98kB ± 0%    3.97kB ± 0%   -0.40%
Soy-24           1.35kB ± 0%    1.32kB ± 0%   -2.37%
JetHTML-24        0.00B          0.00B         0.00%

name           old allocs/op  new allocs/op  delta
Golang-24          35.0 ± 0%      35.0 ± 0%    0.00%
GolangText-24      7.00 ± 0%      7.00 ± 0%    0.00%
Ace-24             40.0 ± 0%      40.0 ± 0%    0.00%
Amber-24           36.0 ± 0%      36.0 ± 0%    0.00%
Mustache-24        29.0 ± 0%      29.0 ± 0%    0.00%
Pongo2-24          32.0 ± 0%      32.0 ± 0%    0.00%
Handlebars-24      78.0 ± 0%      78.0 ± 0%    0.00%
Soy-24             20.0 ± 0%      20.0 ± 0%    0.00%
JetHTML-24         0.00           0.00         0.00%

precompilation to Go code

Name Runs µs/op B/op allocations/op
Ego 2,782,954 1.314 85 8
EgonSlinso 10,311,388 0.305 0 0
Ftmpl 2,095,531 1.710 1,095 12
Gorazor 4,343,186 0.830 512 5
Hero 27,075,139 0.135 0 0
Jade 41,323,922 0.088 0 0
Quicktemplate 13,077,282 0.246 0 0
comparing: go1.15.8 to go version go1.16 linux/amd64
name              old time/op    new time/op    delta
Ego-24              1.30µs ± 0%    1.31µs ± 0%  +1.47%
EgonSlinso-24        287ns ± 0%     305ns ± 0%  +6.31%
Quicktemplate-24     224ns ± 0%     246ns ± 0%  +9.96%
Ftmpl-24            1.90µs ± 0%    1.71µs ± 0%  -9.81%
Gorazor-24           794ns ± 0%     830ns ± 0%  +4.57%
Hero-24              141ns ± 0%     135ns ± 0%  -4.26%
Jade-24             84.1ns ± 0%    87.8ns ± 0%  +4.42%

name              old alloc/op   new alloc/op   delta
Ego-24               85.0B ± 0%     85.0B ± 0%   0.00%
EgonSlinso-24        0.00B          0.00B        0.00%
Quicktemplate-24     0.00B          0.00B        0.00%
Ftmpl-24            1.09kB ± 0%    1.09kB ± 0%   0.00%
Gorazor-24            512B ± 0%      512B ± 0%   0.00%
Hero-24              0.00B          0.00B        0.00%
Jade-24              0.00B          0.00B        0.00%

name              old allocs/op  new allocs/op  delta
Ego-24                8.00 ± 0%      8.00 ± 0%   0.00%
EgonSlinso-24         0.00           0.00        0.00%
Quicktemplate-24      0.00           0.00        0.00%
Ftmpl-24              12.0 ± 0%      12.0 ± 0%   0.00%
Gorazor-24            5.00 ± 0%      5.00 ± 0%   0.00%
Hero-24               0.00           0.00        0.00%
Jade-24               0.00           0.00        0.00%

more complex test with template inheritance (if possible)

full featured template engines

Name Runs µs/op B/op allocations/op
ComplexGolang 49,890 73.015 7,774 285
ComplexGolangText 123,493 31.905 2,532 102
ComplexJetHTML 227,565 14.653 534 5
ComplexMustache 129,079 27.913 7,400 155
comparing: go1.15.8 to go version go1.16 linux/amd64
name                  old time/op    new time/op    delta
ComplexGolang-24        73.1µs ± 0%    73.0µs ± 0%   -0.13%
ComplexGolangText-24    32.2µs ± 0%    31.9µs ± 0%   -0.81%
ComplexMustache-24      27.7µs ± 0%    27.9µs ± 0%   +0.93%
ComplexJetHTML-24       15.8µs ± 0%    14.7µs ± 0%   -7.41%

name                  old alloc/op   new alloc/op   delta
ComplexGolang-24        8.78kB ± 0%    7.77kB ± 0%  -11.49%
ComplexGolangText-24    2.71kB ± 0%    2.53kB ± 0%   -6.50%
ComplexMustache-24      7.57kB ± 0%    7.40kB ± 0%   -2.22%
ComplexJetHTML-24         550B ± 0%      534B ± 0%   -2.91%

name                  old allocs/op  new allocs/op  delta
ComplexGolang-24           285 ± 0%       285 ± 0%    0.00%
ComplexGolangText-24       102 ± 0%       102 ± 0%    0.00%
ComplexMustache-24         155 ± 0%       155 ± 0%    0.00%
ComplexJetHTML-24         5.00 ± 0%      5.00 ± 0%    0.00%

precompilation to Go code

Name Runs µs/op B/op allocations/op
ComplexEgo 536,416 6.340 568 31
ComplexEgoSlinso 1,000,000 3.083 160 2
ComplexFtmpl 480,680 7.638 4,912 38
ComplexGorazor 832,575 4.436 2,720 21
ComplexHero 3,439,156 1.000 0 0
ComplexJade 4,865,839 0.705 0 0
ComplexQuicktemplate 2,812,012 1.258 0 0
comparing: go1.15.8 to go version go1.16 linux/amd64
name                     old time/op    new time/op    delta
ComplexEgo-24              6.55µs ± 0%    6.34µs ± 0%  -3.27%
ComplexQuicktemplate-24    1.18µs ± 0%    1.26µs ± 0%  +6.52%
ComplexEgoSlinso-24        2.83µs ± 0%    3.08µs ± 0%  +8.94%
ComplexFtmpl-24            7.69µs ± 0%    7.64µs ± 0%  -0.71%
ComplexGorazor-24          4.54µs ± 0%    4.44µs ± 0%  -2.33%
ComplexHero-24             1.01µs ± 0%    1.00µs ± 0%  -0.89%
ComplexJade-24              706ns ± 0%     705ns ± 0%  -0.08%

name                     old alloc/op   new alloc/op   delta
ComplexEgo-24                592B ± 0%      568B ± 0%  -4.05%
ComplexQuicktemplate-24     0.00B          0.00B        0.00%
ComplexEgoSlinso-24          160B ± 0%      160B ± 0%   0.00%
ComplexFtmpl-24            4.94kB ± 0%    4.91kB ± 0%  -0.49%
ComplexGorazor-24          2.87kB ± 0%    2.72kB ± 0%  -5.29%
ComplexHero-24              0.00B          0.00B        0.00%
ComplexJade-24              0.00B          0.00B        0.00%

name                     old allocs/op  new allocs/op  delta
ComplexEgo-24                31.0 ± 0%      31.0 ± 0%   0.00%
ComplexQuicktemplate-24      0.00           0.00        0.00%
ComplexEgoSlinso-24          2.00 ± 0%      2.00 ± 0%   0.00%
ComplexFtmpl-24              38.0 ± 0%      38.0 ± 0%   0.00%
ComplexGorazor-24            22.0 ± 0%      21.0 ± 0%  -4.55%
ComplexHero-24               0.00           0.00        0.00%
ComplexJade-24               0.00           0.00        0.00%

Security

All packages assume that template authors are trusted. If you allow custom templates you have to sanitize your user input e.g. bluemonday. Generally speaking I would suggest to sanitize every input not just HTML-input.

Attention: This part is not updated since 2016.

Framework Security Comment
Ace No
amber No
ego Partial (html.EscapeString) only HTML, others need to be called manually
egon Partial (html.EscapeString) only HTML, others need to be called manually
egonslinso Partial (html.EscapeString) only HTML, others need to be called manually
ftmpl Partial (html.EscapeString) only HTML, others need to be called manually
Go Yes contextual escaping html/template Security Model
Gorazor Partial (template.HTMLEscapeString) only HTML, others need to be called manually
Handlebars Partial (raymond.escape) only HTML
Hero Partial (html.EscapeString) only HTML, others need to be called manually
Jade Partial (html.EscapeString) Autoescape for HTML, others need to be called manually
Jet Partial (html.EscapeString) Autoescape for HTML, others need to be called manually
Kasia Partial (kasia.WriteEscapedHtml) only HTML
Mustache Partial (template.HTMLEscape) only HTML
Pongo2 Partial (pongo2.filterEscape, pongo2.filterEscapejs) autoescape only escapes HTML, others could be implemented as pongo filters
Quicktemplate Partial (html.EscapeString) only HTML, others need to be called manually
Soy Partial (template.HTMLEscapeString, url.QueryEscape, template.JSEscapeString) autoescape only escapes HTML, contextual escaping is defined as a project goal
Comments
  • Many errors in test, am I wrong?

    Many errors in test, am I wrong?

    I'm getting many errors, am I wrong?

    "C:\Program Files\Go\bin\go.exe" test -c -o C:\project\AppData\Local\Temp\___templates_test_go.exe github.com/SlinSo/goTemplateBenchmark #gosetup
    "C:\Program Files\Go\bin\go.exe" tool test2json -t C:\project\AppData\Local\Temp\___templates_test_go.exe -test.v -test.run ^\QTestGolang\E|\QTestGolangText\E|\QTestGoFunc\E|\QTestEgo\E|\QTestEgonSlinso\E|\QTestQuicktemplate\E|\QTestFtmpl\E|\QTestAce\E|\QTestAmber\E|\QTestMustache\E|\QTestPongo2\E|\QTestHandlebars\E|\QTestGorazor\E|\QTestSoy\E|\QTestJetHTML\E|\QTestHero\E|\QTestJade\E$ #gosetup
    === RUN   TestGolang
        templates_test.go:72: Lines don't match 
    </html>"
            2:"<html><body><h1>Bob</h1><p>Here's[space]a[space]list[space]of[space]your[space]favorite[space]colors:</p><ul><li>blue</li><li>green</li><li>mauve</li></ul></body></html>"
    --- FAIL: TestGolang (0.00s)
    
    === RUN   TestGolangText
        templates_test.go:88: Lines don't match 
    </html>"
            2:"<html><body><h1>Bob</h1><p>Here's[space]a[space]list[space]of[space]your[space]favorite[space]colors:</p><ul><li>blue</li><li>green</li><li>mauve</li></ul></body></html>"
    --- FAIL: TestGolangText (0.00s)
    
    === RUN   TestGoFunc
    --- PASS: TestGoFunc (0.00s)
    === RUN   TestEgo
    --- PASS: TestEgo (0.00s)
    === RUN   TestEgonSlinso
    --- PASS: TestEgonSlinso (0.00s)
    === RUN   TestQuicktemplate
    --- PASS: TestQuicktemplate (0.00s)
    === RUN   TestFtmpl
    --- PASS: TestFtmpl (0.00s)
    === RUN   TestAce
    --- PASS: TestAce (0.00s)
    === RUN   TestAmber
    --- PASS: TestAmber (0.00s)
    === RUN   TestMustache
        templates_test.go:363: Lines don't match 
    </html>"
            2:"<html><body><h1>Bob</h1><p>Here's[space]a[space]list[space]of[space]your[space]favorite[space]colors:</p><ul><li>blue</li><li>green</li><li>mauve</li></ul></body></html>"
    --- FAIL: TestMustache (0.00s)
    
    === RUN   TestPongo2
        templates_test.go:393: Lines don't match 
    </html>"
            2:"<html><body><h1>Bob</h1><p>Here's[space]a[space]list[space]of[space]your[space]favorite[space]colors:</p><ul><li>blue</li><li>green</li><li>mauve</li></ul></body></html>"
    --- FAIL: TestPongo2 (0.00s)
    
    === RUN   TestHandlebars
        templates_test.go:427: Lines don't match 
    </html>"
            2:"<html><body><h1>Bob</h1><p>Here's[space]a[space]list[space]of[space]your[space]favorite[space]colors:</p><ul><li>blue</li><li>green</li><li>mauve</li></ul></body></html>"
    --- FAIL: TestHandlebars (0.00s)
    
    === RUN   TestGorazor
    --- PASS: TestGorazor (0.00s)
    === RUN   TestSoy
    --- PASS: TestSoy (0.00s)
    === RUN   TestJetHTML
        templates_test.go:519: Lines don't match 
    </html>"
            2:"<html><body><h1>Bob</h1><p>Here's[space]a[space]list[space]of[space]your[space]favorite[space]colors:</p><ul><li>blue</li><li>green</li><li>mauve</li></ul></body></html>"
    --- FAIL: TestJetHTML (0.00s)
    
    === RUN   TestHero
    --- PASS: TestHero (0.00s)
    === RUN   TestJade
    --- PASS: TestJade (0.00s)
    FAIL
    
    Process finished with exit code 1
    

    and

    "C:\Program Files\Go\bin\go.exe" test -c -o C:\project\AppData\Local\Temp\___templates_complex_test_go.exe github.com/SlinSo/goTemplateBenchmark #gosetup
    "C:\Program Files\Go\bin\go.exe" tool test2json -t C:\project\AppData\Local\Temp\___templates_complex_test_go.exe -test.v -test.run ^\QTestComplexGolang\E|\QTestComplexGolangText\E|\QTestComplexEgo\E|\QTestComplexQuicktemplate\E|\QTestComplexEgoSlinso\E|\QTestComplexFtmpl\E|\QTestComplexFtmplInclude\E|\QTestComplexMustache\E|\QTestComplexGorazor\E|\QTestComplexJetHTML\E|\QTestComplexHero\E|\QTestComplexJade\E|\QTestComplexGoFunc\E$ #gosetup
    === RUN   TestComplexGolang
        templates_complex_test.go:132: Lines don't match 
    "
            2:"<!DOCTYPE[space]html><html><body><header><title>Bob's[space]Home[space]Page</title><div[space]class="header">Page[space]Header</div></header><nav><ul[space]class="navigation"><li><a[space]href="http://www.mytest.com/">Link[space]1</a></li><li><a[space]href="http://www.mytest.com/">Link[space]2</a></li><li><a[space]href="http://www.mytest.com/">Link[space]3</a></li></ul></nav><section><div[space]class="content"><div[space]class="welcome"><h4>Hello[space]Bob</h4><div[space]class="raw"><div><p>Raw[space]Content[space]to[space]be[space]displayed</p></div></div><div[space]class="enc">&lt;div&gt;&lt;div&gt;&lt;div&gt;Escaped&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</div></div><p>Bob[space]has[space]1[space]message</p><p>Bob[space]has[space]2[space]messages</p><p>Bob[space]has[space]3[space]messages</p><p>Bob[space]has[space]4[space]messages</p><p>Bob[space]has[space]5[space]messages</p></div></section><footer><div[space]class="footer">copyright[space]2016</div></footer></body></html>"
    --- FAIL: TestComplexGolang (0.00s)
    
    === RUN   TestComplexGolangText
        templates_complex_test.go:167: Lines don't match 
    "
            2:"<!DOCTYPE[space]html><html><body><header><title>Bob's[space]Home[space]Page</title><div[space]class="header">Page[space]Header</div></header><nav><ul[space]class="navigation"><li><a[space]href="http://www.mytest.com/">Link[space]1</a></li><li><a[space]href="http://www.mytest.com/">Link[space]2</a></li><li><a[space]href="http://www.mytest.com/">Link[space]3</a></li></ul></nav><section><div[space]class="content"><div[space]class="welcome"><h4>Hello[space]Bob</h4><div[space]class="raw"><div><p>Raw[space]Content[space]to[space]be[space]displayed</p></div></div><div[space]class="enc">&lt;div&gt;&lt;div&gt;&lt;div&gt;Escaped&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</div></div><p>Bob[space]has[space]1[space]message</p><p>Bob[space]has[space]2[space]messages</p><p>Bob[space]has[space]3[space]messages</p><p>Bob[space]has[space]4[space]messages</p><p>Bob[space]has[space]5[space]messages</p></div></section><footer><div[space]class="footer">copyright[space]2016</div></footer></body></html>"
    --- FAIL: TestComplexGolangText (0.04s)
    
    === RUN   TestComplexEgo
    --- PASS: TestComplexEgo (0.00s)
    === RUN   TestComplexQuicktemplate
    --- PASS: TestComplexQuicktemplate (0.00s)
    === RUN   TestComplexEgoSlinso
    --- PASS: TestComplexEgoSlinso (0.00s)
    === RUN   TestComplexFtmpl
    --- PASS: TestComplexFtmpl (0.00s)
    === RUN   TestComplexFtmplInclude
    --- PASS: TestComplexFtmplInclude (0.00s)
    === RUN   TestComplexMustache
        templates_complex_test.go:351: Lines don't match 
    </html>"
            2:"<!DOCTYPE[space]html><html><body><header><title>Bob's[space]Home[space]Page</title><div[space]class="header">Page[space]Header</div></header><nav><ul[space]class="navigation"><li><a[space]href="http://www.mytest.com/">Link[space]1</a></li><li><a[space]href="http://www.mytest.com/">Link[space]2</a></li><li><a[space]href="http://www.mytest.com/">Link[space]3</a></li></ul></nav><section><div[space]class="content"><div[space]class="welcome"><h4>Hello[space]Bob</h4><div[space]class="raw"><div><p>Raw[space]Content[space]to[space]be[space]displayed</p></div></div><div[space]class="enc">&lt;div&gt;&lt;div&gt;&lt;div&gt;Escaped&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</div></div><p>Bob[space]has[space]1[space]message</p><p>Bob[space]has[space]2[space]messages</p><p>Bob[space]has[space]3[space]messages</p><p>Bob[space]has[space]4[space]messages</p><p>Bob[space]has[space]5[space]messages</p></div></section><footer><div[space]class="footer">copyright[space]2016</div></footer></body></html>"
    --- FAIL: TestComplexMustache (0.00s)
    
    === RUN   TestComplexGorazor
    --- PASS: TestComplexGorazor (0.00s)
    === RUN   TestComplexJetHTML
        templates_complex_test.go:400: Lines don't match 
    "
            2:"<!DOCTYPE[space]html><html><body><header><title>Bob's[space]Home[space]Page</title><div[space]class="header">Page[space]Header</div></header><nav><ul[space]class="navigation"><li><a[space]href="http://www.mytest.com/">Link[space]1</a></li><li><a[space]href="http://www.mytest.com/">Link[space]2</a></li><li><a[space]href="http://www.mytest.com/">Link[space]3</a></li></ul></nav><section><div[space]class="content"><div[space]class="welcome"><h4>Hello[space]Bob</h4><div[space]class="raw"><div><p>Raw[space]Content[space]to[space]be[space]displayed</p></div></div><div[space]class="enc">&lt;div&gt;&lt;div&gt;&lt;div&gt;Escaped&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</div></div><p>Bob[space]has[space]1[space]message</p><p>Bob[space]has[space]2[space]messages</p><p>Bob[space]has[space]3[space]messages</p><p>Bob[space]has[space]4[space]messages</p><p>Bob[space]has[space]5[space]messages</p></div></section><footer><div[space]class="footer">copyright[space]2016</div></footer></body></html>"
    --- FAIL: TestComplexJetHTML (0.00s)
    
    === RUN   TestComplexHero
    --- PASS: TestComplexHero (0.00s)
    === RUN   TestComplexJade
    --- PASS: TestComplexJade (0.00s)
    === RUN   TestComplexGoFunc
    --- PASS: TestComplexGoFunc (0.00s)
    FAIL
    
    Process finished with exit code 1
    
  • How do you run the benchmarks?

    How do you run the benchmarks?

    What is the command to run the benchmarks?

    Tried

    ./bench.sh
    

    Got

    Setting go versions which will be compared with -c or --compare is required
    
      -t --time  [arg]   Benchmark duration. Required. Default="3s"
      -c --compare [arg] Old go version binary? Required.
      -g --go [arg]      Curenct go version binary? Required. Default="go"
      -B --no-benchmarks Do NOT run the benchmarks.
      -F --no-format     Do NOT format the results.
      -u --update        update dependencies.
      -v                 Enable verbose mode, print script as it is executed
      -d --debug         Enables debug mode
      -h --help          This page
    

    Tried

    ./bench.sh -O -F
    
    ./bench.sh: illegal option -- O
    
     Invalid use of script: -O -F 
    
      -t --time  [arg]   Benchmark duration. Required. Default="3s"
      -c --compare [arg] Old go version binary? Required.
      -g --go [arg]      Curenct go version binary? Required. Default="go"
      -B --no-benchmarks Do NOT run the benchmarks.
      -F --no-format     Do NOT format the results.
      -u --update        update dependencies.
      -v                 Enable verbose mode, print script as it is executed
      -d --debug         Enables debug mode
      -h --help          This page
    
  • Refresh benchmark results

    Refresh benchmark results

    It would be great periodically refreshing benchmark results after go get -u and go generate for all the template engines, since they may be modified sometimes.

    Additionally, it would be great to see results fo go 1.8 which should be released today.

  • Update codegen with gorazor 2.0

    Update codegen with gorazor 2.0

    Hi, I'm the author of gorazor.

    I just release gorazor 2.0, which contains performance optimization.

    I've updated generated codes of gorazor for benchmark.

  • update hero

    update hero

    Hero's API now is changed. The function now doesn't depend hero.GetBuffer() and hero.PutBuffer().

    And there also are some performance optimization, so could you please make benchmarks again and update the README?

    Thanks.

  • Add complex test and benchmark for Jet

    Add complex test and benchmark for Jet

    Jet supports template inheritance and extending a layout (among other things) so I added a complex test case and accompanying benchmark. Results are good for B/op and allocs/op:

    go test . -bench="Complex" -benchmem -benchtime=3s
    BenchmarkComplexGolang-8                  100000             49658 ns/op           12415 B/op        295 allocs/op
    BenchmarkComplexEgo-8                    1000000              6189 ns/op            2561 B/op         41 allocs/op
    BenchmarkComplexQuicktemplate-8          2000000              3121 ns/op            1892 B/op          0 allocs/op
    BenchmarkComplexEgon-8                    300000             11663 ns/op            4792 B/op        101 allocs/op
    BenchmarkComplexEgoSlinso-8              2000000              2790 ns/op            2070 B/op          7 allocs/op
    BenchmarkComplexFtmpl-8                   500000              6435 ns/op            5300 B/op         48 allocs/op
    BenchmarkComplexFtmplInclude-8           1000000              6505 ns/op            5300 B/op         48 allocs/op
    BenchmarkComplexMustache-8                200000             26515 ns/op            7856 B/op        166 allocs/op
    BenchmarkComplexGorazor-8                 300000             12027 ns/op            8327 B/op         73 allocs/op
    BenchmarkComplexJetHTML-8                 300000             12083 ns/op            3561 B/op          5 allocs/op
    PASS
    

    Could you also add a link to the Jet repo in the README at the top to the »full featured template engines«, please? That'd be awesome!

  • Add osteele/liquid

    Add osteele/liquid

    It would be great to have https://github.com/osteele/liquid here too. There is actually an issue on their repo but no one has picked this up: https://github.com/osteele/liquid/issues/31

Goview is a lightweight, minimalist and idiomatic template library based on golang html/template for building Go web application.

goview Goview is a lightweight, minimalist and idiomatic template library based on golang html/template for building Go web application. Contents Inst

Dec 25, 2022
Fast, powerful, yet easy to use template engine for Go. Optimized for speed, zero memory allocations in hot paths. Up to 20x faster than html/template

quicktemplate A fast, powerful, yet easy to use template engine for Go. Inspired by the Mako templates philosophy. Features Extremely fast. Templates

Dec 26, 2022
Simple system for writing HTML/XML as Go code. Better-performing replacement for html/template and text/template

Simple system for writing HTML as Go code. Use normal Go conditionals, loops and functions. Benefit from typing and code analysis. Better performance than templating. Tiny and dependency-free.

Dec 5, 2022
A template to build dynamic web apps quickly using Go, html/template and javascript
A template to build dynamic web apps quickly using Go, html/template and javascript

gomodest-template A modest template to build dynamic web apps in Go, HTML and sprinkles and spots of javascript. Why ? Build dynamic websites using th

Dec 29, 2022
Made from template temporalio/money-transfer-project-template-go
Made from template temporalio/money-transfer-project-template-go

Temporal Go Project Template This is a simple project for demonstrating Temporal with the Go SDK. The full 20 minute guide is here: https://docs.tempo

Jan 6, 2022
Go-project-template - Template for a golang project

This is a template repository for golang project Usage Go to github: https://git

Oct 25, 2022
Go-api-template - A rough template to give you a starting point for your API

Golang API Template This is only a rough template to give you a starting point f

Jan 14, 2022
Api-go-template - A simple Go API template that uses a controller-service based model to build its routes

api-go-template This is a simple Go API template that uses a controller-service

Feb 18, 2022
This application provides different tools for multiple purposes
This application provides different tools for multiple purposes

Welcome to readme-md-generator ?? CLI that generates beautiful README.md files. readme-md-generator will suggest you default answers by reading your p

Dec 26, 2022
HTML template engine for Go

Ace - HTML template engine for Go Overview Ace is an HTML template engine for Go. This is inspired by Slim and Jade. This is a refinement of Gold. Exa

Jan 4, 2023
Package damsel provides html outlining via css-selectors and common template functionality.

Damsel Markup language featuring html outlining via css-selectors, extensible via pkg html/template and others. Library This package expects to exist

Oct 23, 2022
Simple and fast template engine for Go

fasttemplate Simple and fast template engine for Go. Fasttemplate performs only a single task - it substitutes template placeholders with user-defined

Dec 30, 2022
A handy, fast and powerful go template engine.
A handy, fast and powerful go template engine.

Hero Hero is a handy, fast and powerful go template engine, which pre-compiles the html templates to go code. It has been used in production environme

Dec 27, 2022
Jet template engine

Jet Template Engine for Go Jet is a template engine developed to be easy to use, powerful, dynamic, yet secure and very fast. simple and familiar synt

Jan 4, 2023
A complete Liquid template engine in Go
A complete Liquid template engine in Go

Liquid Template Parser liquid is a pure Go implementation of Shopify Liquid templates. It was developed for use in the Gojekyll port of the Jekyll sta

Dec 15, 2022
The mustache template language in Go

Overview mustache.go is an implementation of the mustache template language in Go. It is better suited for website templates than Go's native pkg/temp

Dec 22, 2022
Useful template functions for Go templates.

Sprig: Template functions for Go templates The Go language comes with a built-in template language, but not very many template functions. Sprig is a l

Jan 4, 2023
The powerful template system that Go needs

Plush Plush is the templating system that Go both needs and deserves. Powerful, flexible, and extendable, Plush is there to make writing your template

Dec 29, 2022
Simple template suitable for building a webapp backend MVP written in go

A Simple Go Project Template - Suited for Webapp MVPs A simple go project structure setup with all dependencies you need to get your MVP off the groun

Oct 23, 2022