Iris is a fast, simple yet fully-featured, and highly efficient Golang web application framework.
It provides expressive and easy-to-use foundation for your next website or application interface.
Iris features
- HTTP/2 (push, even embedded data)
- Middleware (Accesslog, Basicauth, CORS, gRPC, Anti-Bot hCaptcha, JWT, MethodOverride, ModRevision, Monitor, PPROF, Ratelimit, Anti-Bot reCaptcha, Recovery, RequestID, Rewrite)
- API versioning
- Model-View-Controller
- Websockets
- gRPC
- Automatic HTTPS
- Built-in ngrok support to put your application online in the fastest way possible
- Unique router with dynamic path parameters, supporting standard types like :uuid, :string, :int, and custom router creation
- Compression
- View engines (HTML, Django, Handlebars, Pug/Jade, etc.)
- Create your own file server and host your own WebDAV server
- Caching
- Localization (i18n, sitemap)
- Sessions
- Rich responses (HTML, text, Markdown, XML, YAML, binary, JSON, JSONP, Protocol Buffers, MessagePack, content negotiation, stream, server-sent events, etc.)
- Response compression (gzip, deflate, brotli, snappy, s2)
- Rich requests (bind URL query, headers, forms, text, XML, YAML, binary, JSON, validation, Protocol Buffers, MessagePack, etc.)
- Dependency injection (MVC, handlers, API routers)
- Testing suite
Demo
package main
// Import package
import "github.com/kataras/iris/v12"
func main() {
// Define iris instance
app := iris.New()
// Use gzip compression middleware
app.Use(iris.Compression)
// Router setup
app.Get("/", func(ctx iris.Context) {
ctx.HTML("Hello <strong>%s</strong>!", "World")
})
// Listen on port
app.Listen(":8080")
}
Performance Testing
Send 200,000 requests with dynamic parameters as integers, sending JSON as the request body, and receiving JSON as the response.
Framework | Development Language | Requests per Second | Latency | Throughput | Completion Time |
---|---|---|---|---|---|
Iris | Go | 238,954 | 521.69us | 64.15MB | 0.84s |
Gin | Go | 229,665 | 541.96us | 62.86MB | 0.87s |
Chi | Go | 228,072 | 545.78us | 62.61MB | 0.88s |
Echo | Go | 224,491 | 553.84us | 61.70MB | 0.89s |
Martini | Go | 198,166 | 627.46us | 54.47MB | 1.01s |
Kestrel | C# | 163,486 | 766.90us | 47.42MB | 1.23s |
Buffalo | Go | 102,478 | 1.22ms | 28.14MB | 1.95s |
Koa | Javascript | 48,425 | 2.56ms | 15.39MB | 4.14s |
Express | Javascript | 23,622 | 5.25ms | 9.04MB | 8.41s |