mirror of
https://github.com/kataras/iris.git
synced 2025-12-24 05:17:03 +00:00
update view benchmarks and remove ace template parser
This commit is contained in:
@@ -1,26 +1,27 @@
|
||||
# View Engine Benchmarks
|
||||
|
||||
Benchmark between all 8 supported template parsers.
|
||||
Benchmark between all 7 supported template parsers.
|
||||
|
||||
Amber, Ace and Pug parsers minifies the template before render. So, to have a fair benchmark, we must make sure that the byte amount of the total response body is exactly the same across all. Therefore, all other template files are minified too.
|
||||
Ace and Pug parsers minifies the template before render. So, to have a fair benchmark, we must make sure that the byte amount of the total response body is exactly the same across all. Therefore, all other template files are minified too.
|
||||
|
||||

|
||||
|
||||
> Last updated: Oct 1, 2020 at 12:46pm (UTC)
|
||||
> Last updated: Mar 17, 2023 at 10:31am (UTC)
|
||||
|
||||
## System
|
||||
|
||||
| | |
|
||||
|----|:---|
|
||||
| Processor | Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz |
|
||||
| RAM | 15.85 GB |
|
||||
| OS | Microsoft Windows 10 Pro |
|
||||
| Processor | 12th Gen Intel(R) Core(TM) i7-12700H |
|
||||
| RAM | 15.68 GB |
|
||||
| OS | Microsoft Windows 11 Pro |
|
||||
| [Bombardier](https://github.com/codesenberg/bombardier) | v1.2.4 |
|
||||
| [Go](https://golang.org) | go1.15.2 |
|
||||
| [Go](https://golang.org) | go1.20.2 |
|
||||
| [Node.js](https://nodejs.org/) | v19.5.0 |
|
||||
|
||||
## Terminology
|
||||
|
||||
**Name** is the name of the template engine used under a particular test.
|
||||
**Name** is the name of the framework(or router) used under a particular test.
|
||||
|
||||
**Reqs/sec** is the avg number of total requests could be processed per second (the higher the better).
|
||||
|
||||
@@ -38,19 +39,18 @@ Amber, Ace and Pug parsers minifies the template before render. So, to have a fa
|
||||
|
||||
| Name | Language | Reqs/sec | Latency | Throughput | Time To Complete |
|
||||
|------|:---------|:---------|:--------|:-----------|:-----------------|
|
||||
| [Amber](./amber) | Go |125698 |0.99ms |44.67MB |7.96s |
|
||||
| [Blocks](./blocks) | Go |123974 |1.01ms |43.99MB |8.07s |
|
||||
| [Django](./django) | Go |118831 |1.05ms |42.17MB |8.41s |
|
||||
| [Handlebars](./handlebars) | Go |101214 |1.23ms |35.91MB |9.88s |
|
||||
| [Pug](./pug) | Go |89002 |1.40ms |31.81MB |11.24s |
|
||||
| [Ace](./ace) | Go |64782 |1.93ms |22.98MB |15.44s |
|
||||
| [HTML](./html) | Go |53918 |2.32ms |19.13MB |18.55s |
|
||||
| [Jet](./jet) | Go |4829 |25.88ms |1.71MB |207.07s |
|
||||
| [Jet](./jet) | Go |248957 |500.81us |88.26MB |4.02s |
|
||||
| [Blocks](./blocks) | Go |238854 |521.76us |84.74MB |4.19s |
|
||||
| [Pug](./pug) | Go |238153 |523.74us |85.07MB |4.20s |
|
||||
| [Django](./django) | Go |224448 |555.40us |79.61MB |4.46s |
|
||||
| [Handlebars](./handlebars) | Go |197267 |631.99us |69.96MB |5.07s |
|
||||
| [Ace](./ace) | Go |157415 |792.53us |55.83MB |6.35s |
|
||||
| [HTML](./html) | Go |120811 |1.03ms |42.82MB |8.29s |
|
||||
|
||||
## How to Run
|
||||
|
||||
```sh
|
||||
$ go install github.com/kataras/server-benchmarks@latest
|
||||
$ go install github.com/codesenberg/bombardier@latest
|
||||
$ go install github.com/kataras/server-benchmarks@master
|
||||
$ go install github.com/codesenberg/bombardier@master
|
||||
$ server-benchmarks --wait-run=3s -o ./results
|
||||
```
|
||||
|
||||
@@ -3,6 +3,6 @@ html
|
||||
head
|
||||
title {{.Title}}
|
||||
body
|
||||
{{ yield . . }}
|
||||
{{ yield . }}
|
||||
footer
|
||||
= include partials/footer.ace .
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
package main
|
||||
|
||||
import "github.com/kataras/iris/v12"
|
||||
|
||||
func main() {
|
||||
app := iris.New()
|
||||
// By default Amber engine minifies the template before render.
|
||||
app.RegisterView(iris.Amber("./views", ".amber"))
|
||||
|
||||
app.Get("/", index)
|
||||
|
||||
app.Listen(":8080")
|
||||
}
|
||||
|
||||
func index(ctx iris.Context) {
|
||||
data := iris.Map{
|
||||
"Title": "Page Title",
|
||||
"FooterText": "Footer contents",
|
||||
"Message": "Main contents",
|
||||
}
|
||||
|
||||
// On Amber this is ignored: ctx.ViewLayout("layouts/main")
|
||||
// Layouts are only rendered from inside the index page itself
|
||||
// using the "extends" keyword.
|
||||
if err := ctx.View("index", data); err != nil {
|
||||
ctx.HTML("<h3>%s</h3>", err.Error())
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
extends layouts/main.amber
|
||||
|
||||
block content
|
||||
h1 Index Body
|
||||
h3 Message: #{Message}
|
||||
@@ -1,8 +0,0 @@
|
||||
doctype html
|
||||
html
|
||||
head
|
||||
title #{Title}
|
||||
body
|
||||
block content
|
||||
footer
|
||||
#{render("partials/footer.amber", $)}
|
||||
@@ -1,2 +0,0 @@
|
||||
h3 Footer Partial
|
||||
h4 #{FooterText}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 16 KiB |
@@ -11,8 +11,6 @@
|
||||
Envs:
|
||||
- Name: Ace
|
||||
Dir: ./ace
|
||||
- Name: Amber
|
||||
Dir: ./amber
|
||||
- Name: Blocks
|
||||
Dir: ./blocks
|
||||
- Name: Django
|
||||
|
||||
Reference in New Issue
Block a user