",
"license": "ISC",
"dependencies": {
- "express": "^4.16.0"
+ "express": "^4.16.0",
+ "express-session": "^1.15.6",
+ "session-memory-store": "^0.2.2",
+ "throng": "4.0.0"
}
}
diff --git a/_benchmarks/expressjs-throng/app.js b/_benchmarks/expressjs-throng/app.js
new file mode 100644
index 00000000..6ae95c34
--- /dev/null
+++ b/_benchmarks/expressjs-throng/app.js
@@ -0,0 +1,22 @@
+process.env.NODE_ENV = 'production';
+
+const express = require('express');
+const createWorker = require('throng');
+
+
+createWorker(createWebServer)
+
+function createWebServer() {
+ const app = express();
+
+ app.get('/api/values/:id', function (req, res) {
+ res.send('value');
+ });
+
+ app.listen(5000, function () {
+ console.log(
+ 'Now listening on: http://localhost:5000\nApplication started. Press CTRL+C to shut down.'
+ )
+ });
+
+}
\ No newline at end of file
diff --git a/_benchmarks/expressjs/package-lock.json b/_benchmarks/expressjs-throng/package-lock.json
similarity index 96%
rename from _benchmarks/expressjs/package-lock.json
rename to _benchmarks/expressjs-throng/package-lock.json
index 24d6e0ec..6747dc5e 100644
--- a/_benchmarks/expressjs/package-lock.json
+++ b/_benchmarks/expressjs-throng/package-lock.json
@@ -192,6 +192,11 @@
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.5.2.tgz",
"integrity": "sha1-1LUFvemUaYfM8PxY2QEP+WB+P6A="
},
+ "lodash.defaults": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz",
+ "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw="
+ },
"media-typer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
@@ -329,6 +334,14 @@
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz",
"integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4="
},
+ "throng": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/throng/-/throng-4.0.0.tgz",
+ "integrity": "sha1-mDxroZk7WOroWZmKpof/6I34TBc=",
+ "requires": {
+ "lodash.defaults": "4.2.0"
+ }
+ },
"type-is": {
"version": "1.6.15",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz",
diff --git a/_benchmarks/expressjs-sessions/package.json b/_benchmarks/expressjs-throng/package.json
similarity index 90%
rename from _benchmarks/expressjs-sessions/package.json
rename to _benchmarks/expressjs-throng/package.json
index 39c15b0a..c5f53166 100644
--- a/_benchmarks/expressjs-sessions/package.json
+++ b/_benchmarks/expressjs-throng/package.json
@@ -10,6 +10,6 @@
"license": "ISC",
"dependencies": {
"express": "^4.16.0",
- "express-session": "^1.15.6"
+ "throng": "4.0.0"
}
-}
\ No newline at end of file
+}
diff --git a/_benchmarks/expressjs/app.js b/_benchmarks/expressjs/app.js
deleted file mode 100644
index db4c4587..00000000
--- a/_benchmarks/expressjs/app.js
+++ /dev/null
@@ -1,14 +0,0 @@
-process.env.NODE_ENV = 'production';
-
-const express = require('express');
-const app = express();
-
-app.get('/api/values/:id', function (req, res) {
- res.send('value');
-});
-
-app.listen(5000, function () {
- console.log(
- 'Now listening on: http://localhost:5000\nApplication started. Press CTRL+C to shut down.'
- )
-});
\ No newline at end of file
diff --git a/_benchmarks/iris-mvc-templates/controllers/home_controller.go b/_benchmarks/iris-mvc-templates/controllers/home_controller.go
new file mode 100644
index 00000000..30e65505
--- /dev/null
+++ b/_benchmarks/iris-mvc-templates/controllers/home_controller.go
@@ -0,0 +1,27 @@
+package controllers
+
+import "github.com/kataras/iris/mvc"
+
+type HomeController struct{ mvc.C }
+
+func (c *HomeController) Get() mvc.Result {
+ return mvc.View{Name: "index.html"}
+}
+
+func (c *HomeController) GetAbout() mvc.Result {
+ return mvc.View{
+ Name: "about.html",
+ Data: map[string]interface{}{
+ "Title": "About Page",
+ "Message": "Your application description page."},
+ }
+}
+
+func (c *HomeController) GetContact() mvc.Result {
+ return mvc.View{
+ Name: "contact.html",
+ Data: map[string]interface{}{
+ "Title": "Contact Page",
+ "Message": "Your application description page."},
+ }
+}
diff --git a/_benchmarks/iris-mvc-templates/controllers/index_controller_heavy.go b/_benchmarks/iris-mvc-templates/controllers/index_controller_heavy.go
deleted file mode 100644
index 3f0e4465..00000000
--- a/_benchmarks/iris-mvc-templates/controllers/index_controller_heavy.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package controllers
-
-import "github.com/kataras/iris/mvc"
-
-type IndexControllerHeavy struct{ mvc.C }
-
-func (c *IndexControllerHeavy) Get() mvc.View {
- return mvc.View{
- Name: "index.html",
- Data: map[string]interface{}{
- "Title": "Home Page",
- },
- }
-}
diff --git a/_benchmarks/iris-mvc-templates/main.go b/_benchmarks/iris-mvc-templates/main.go
index 5c1dd7c8..bde260e4 100644
--- a/_benchmarks/iris-mvc-templates/main.go
+++ b/_benchmarks/iris-mvc-templates/main.go
@@ -8,28 +8,29 @@ import (
)
const (
- // templatesDir is the exactly the same path that .NET Core is using for its templates,
+ // publicDir is the exactly the same path that .NET Core is using for its templates,
// in order to reduce the size in the repository.
// Change the "C\\mygopath" to your own GOPATH.
- templatesDir = "C:\\mygopath\\src\\github.com\\kataras\\iris\\_benchmarks\\netcore-mvc-templates\\wwwroot"
+ // publicDir = "C:\\mygopath\\src\\github.com\\kataras\\iris\\_benchmarks\\netcore-mvc-templates\\wwwroot"
+ publicDir = "/home/kataras/mygopath/src/github.com/kataras/iris/_benchmarks/netcore-mvc-templates/wwwroot"
)
func main() {
app := iris.New()
app.Configure(configure)
- app.Controller("/", new(controllers.IndexController))
- app.Controller("/about", new(controllers.AboutController))
- app.Controller("/contact", new(controllers.ContactController))
+ // app.Controller("/", new(controllers.IndexController))
+ // app.Controller("/about", new(controllers.AboutController))
+ // app.Controller("/contact", new(controllers.ContactController))
+
+ app.Controller("/", new(controllers.HomeController))
- // 24 August 2017: Iris has a built'n version updater but we don't need it
- // when benchmarking...
app.Run(iris.Addr(":5000"), iris.WithoutVersionChecker)
}
func configure(app *iris.Application) {
app.RegisterView(iris.HTML("./views", ".html").Layout("shared/layout.html"))
- app.StaticWeb("/public", templatesDir)
+ app.StaticWeb("/public", publicDir)
app.OnAnyErrorCode(onError)
}
diff --git a/_benchmarks/iris-mvc/controllers/values_controller.go b/_benchmarks/iris-mvc/controllers/values_controller.go
index 9b425848..c560a641 100644
--- a/_benchmarks/iris-mvc/controllers/values_controller.go
+++ b/_benchmarks/iris-mvc/controllers/values_controller.go
@@ -5,13 +5,19 @@ import "github.com/kataras/iris/mvc"
// ValuesController is the equivalent
// `ValuesController` of the .net core 2.0 mvc application.
type ValuesController struct {
- mvc.Controller
+ mvc.C
}
-// Get handles "GET" requests to "api/values/{id}".
+/* on windows tests(older) the Get was:
func (vc *ValuesController) Get() {
// id,_ := vc.Params.GetInt("id")
- vc.Ctx.WriteString("value")
+ // vc.Ctx.WriteString("value")
+}
+but as Iris is always going better, now supports return values as well*/
+
+// Get handles "GET" requests to "api/values/{id}".
+func (vc *ValuesController) Get() string {
+ return "value"
}
// Put handles "PUT" requests to "api/values/{id}".
diff --git a/_benchmarks/iris/main.go b/_benchmarks/iris/main.go
index d9ee27de..ef5d1090 100644
--- a/_benchmarks/iris/main.go
+++ b/_benchmarks/iris/main.go
@@ -11,7 +11,5 @@ func main() {
ctx.WriteString("value")
})
- // 24 August 2017: Iris has a built'n version updater but we don't need it
- // when benchmarking...
app.Run(iris.Addr(":5000"), iris.WithoutVersionChecker)
}
diff --git a/_benchmarks/netcore-mvc-templates/Controllers/HomeController.cs b/_benchmarks/netcore-mvc-templates/Controllers/HomeController.cs
index 3b86f746..09ca6f65 100644
--- a/_benchmarks/netcore-mvc-templates/Controllers/HomeController.cs
+++ b/_benchmarks/netcore-mvc-templates/Controllers/HomeController.cs
@@ -17,6 +17,7 @@ namespace netcore_mvc_templates.Controllers
public IActionResult About()
{
+ ViewData["Title"] = "About Page";
ViewData["Message"] = "Your application description page.";
return View();
@@ -24,6 +25,7 @@ namespace netcore_mvc_templates.Controllers
public IActionResult Contact()
{
+ ViewData["Title"] = "Contact Page";
ViewData["Message"] = "Your contact page.";
return View();
diff --git a/_benchmarks/netcore-mvc-templates/Views/Home/About.cshtml b/_benchmarks/netcore-mvc-templates/Views/Home/About.cshtml
index d6c9ce51..2052e8ae 100644
--- a/_benchmarks/netcore-mvc-templates/Views/Home/About.cshtml
+++ b/_benchmarks/netcore-mvc-templates/Views/Home/About.cshtml
@@ -1,7 +1,4 @@
-@{
- ViewData["Title"] = "About";
-}
-@ViewData["Title"]
+@ViewData["Title"]
@ViewData["Message"]
Use this area to provide additional information.
diff --git a/_benchmarks/netcore-mvc-templates/Views/Home/Contact.cshtml b/_benchmarks/netcore-mvc-templates/Views/Home/Contact.cshtml
index 57b40cc4..0c790fb1 100644
--- a/_benchmarks/netcore-mvc-templates/Views/Home/Contact.cshtml
+++ b/_benchmarks/netcore-mvc-templates/Views/Home/Contact.cshtml
@@ -1,7 +1,4 @@
-@{
- ViewData["Title"] = "Contact";
-}
-@ViewData["Title"]
+@ViewData["Title"]
@ViewData["Message"]
diff --git a/_benchmarks/netcore-mvc-templates/Views/Home/Index.cshtml b/_benchmarks/netcore-mvc-templates/Views/Home/Index.cshtml
index ddaa40c6..ad7c22c0 100644
--- a/_benchmarks/netcore-mvc-templates/Views/Home/Index.cshtml
+++ b/_benchmarks/netcore-mvc-templates/Views/Home/Index.cshtml
@@ -1,8 +1,4 @@
-@{
- ViewData["Title"] = "Home Page";
-}
-
-
+
diff --git a/_benchmarks/netcore-mvc/netcore-mvc.csproj b/_benchmarks/netcore-mvc/netcore-mvc.csproj
index 60ee45be..e071cdd5 100644
--- a/_benchmarks/netcore-mvc/netcore-mvc.csproj
+++ b/_benchmarks/netcore-mvc/netcore-mvc.csproj
@@ -5,7 +5,7 @@
-
+
diff --git a/_benchmarks/screens/unix/system_info_cpu.png b/_benchmarks/screens/unix/system_info_cpu.png
new file mode 100644
index 00000000..df91e815
Binary files /dev/null and b/_benchmarks/screens/unix/system_info_cpu.png differ
diff --git a/_benchmarks/screens/unix/unix_1m_requests_expressjs-throng-sessions.png b/_benchmarks/screens/unix/unix_1m_requests_expressjs-throng-sessions.png
new file mode 100644
index 00000000..28d925c1
Binary files /dev/null and b/_benchmarks/screens/unix/unix_1m_requests_expressjs-throng-sessions.png differ
diff --git a/_benchmarks/screens/unix/unix_1m_requests_expressjs-throng.png b/_benchmarks/screens/unix/unix_1m_requests_expressjs-throng.png
new file mode 100644
index 00000000..ee0d3262
Binary files /dev/null and b/_benchmarks/screens/unix/unix_1m_requests_expressjs-throng.png differ
diff --git a/_benchmarks/screens/unix/unix_1m_requests_iris-mvc-templates.png b/_benchmarks/screens/unix/unix_1m_requests_iris-mvc-templates.png
new file mode 100644
index 00000000..94b5e000
Binary files /dev/null and b/_benchmarks/screens/unix/unix_1m_requests_iris-mvc-templates.png differ
diff --git a/_benchmarks/screens/unix/unix_1m_requests_iris-mvc.png b/_benchmarks/screens/unix/unix_1m_requests_iris-mvc.png
new file mode 100644
index 00000000..b4573e07
Binary files /dev/null and b/_benchmarks/screens/unix/unix_1m_requests_iris-mvc.png differ
diff --git a/_benchmarks/screens/unix/unix_1m_requests_iris-sessions.png b/_benchmarks/screens/unix/unix_1m_requests_iris-sessions.png
new file mode 100644
index 00000000..66e15cf6
Binary files /dev/null and b/_benchmarks/screens/unix/unix_1m_requests_iris-sessions.png differ
diff --git a/_benchmarks/screens/unix/unix_1m_requests_iris.png b/_benchmarks/screens/unix/unix_1m_requests_iris.png
new file mode 100644
index 00000000..4fcd203e
Binary files /dev/null and b/_benchmarks/screens/unix/unix_1m_requests_iris.png differ
diff --git a/_benchmarks/screens/unix/unix_1m_requests_netcore-mvc-templates.png b/_benchmarks/screens/unix/unix_1m_requests_netcore-mvc-templates.png
new file mode 100644
index 00000000..1b27bc7d
Binary files /dev/null and b/_benchmarks/screens/unix/unix_1m_requests_netcore-mvc-templates.png differ
diff --git a/_benchmarks/screens/unix/unix_1m_requests_netcore-mvc.png b/_benchmarks/screens/unix/unix_1m_requests_netcore-mvc.png
new file mode 100644
index 00000000..8066799a
Binary files /dev/null and b/_benchmarks/screens/unix/unix_1m_requests_netcore-mvc.png differ
diff --git a/_benchmarks/screens/unix/unix_1m_requests_netcore-sessions.png b/_benchmarks/screens/unix/unix_1m_requests_netcore-sessions.png
new file mode 100644
index 00000000..88fd2944
Binary files /dev/null and b/_benchmarks/screens/unix/unix_1m_requests_netcore-sessions.png differ
diff --git a/_benchmarks/screens/unix/unix_1m_requests_netcore.png b/_benchmarks/screens/unix/unix_1m_requests_netcore.png
new file mode 100644
index 00000000..a3c017cf
Binary files /dev/null and b/_benchmarks/screens/unix/unix_1m_requests_netcore.png differ
diff --git a/_benchmarks/screens/unix/unix_5m_requests_expressjs-throng-sessions.png b/_benchmarks/screens/unix/unix_5m_requests_expressjs-throng-sessions.png
new file mode 100644
index 00000000..15a72bce
Binary files /dev/null and b/_benchmarks/screens/unix/unix_5m_requests_expressjs-throng-sessions.png differ
diff --git a/_benchmarks/screens/unix/unix_5m_requests_iris-mvc.png b/_benchmarks/screens/unix/unix_5m_requests_iris-mvc.png
new file mode 100644
index 00000000..3f6a0a54
Binary files /dev/null and b/_benchmarks/screens/unix/unix_5m_requests_iris-mvc.png differ
diff --git a/_benchmarks/screens/unix/unix_5m_requests_iris-sessions.png b/_benchmarks/screens/unix/unix_5m_requests_iris-sessions.png
new file mode 100644
index 00000000..f57a6b9c
Binary files /dev/null and b/_benchmarks/screens/unix/unix_5m_requests_iris-sessions.png differ
diff --git a/_benchmarks/screens/unix/unix_5m_requests_netcore-mvc.png b/_benchmarks/screens/unix/unix_5m_requests_netcore-mvc.png
new file mode 100644
index 00000000..9378a677
Binary files /dev/null and b/_benchmarks/screens/unix/unix_5m_requests_netcore-mvc.png differ
diff --git a/_benchmarks/screens/unix/unix_5m_requests_netcore-sessions.png b/_benchmarks/screens/unix/unix_5m_requests_netcore-sessions.png
new file mode 100644
index 00000000..6fb0614a
Binary files /dev/null and b/_benchmarks/screens/unix/unix_5m_requests_netcore-sessions.png differ
diff --git a/_benchmarks/screens/unix/unix_system_info_ram.png b/_benchmarks/screens/unix/unix_system_info_ram.png
new file mode 100644
index 00000000..fedfd7bd
Binary files /dev/null and b/_benchmarks/screens/unix/unix_system_info_ram.png differ