作家
登录

论HTTP性能,Go与.NET Core一争雌雄

作者: 来源: 2017-10-10 13:48:24 阅读 我要评论

    1xx - 0, 2xx - 5000000, 3xx - 0, 4xx - 0, 5xx - 0 
  •     others - 0 
  •   Throughput:     8.91MB/s 
  • Iris MVC


    Logo 由 Santosh Anand 设计。

    源代码:

    1. package main 
    2. import ( 
    3.     "github.com/kataras/iris" 
    4.     "github.com/kataras/iris/_benchmarks/iris-mvc/controllers" 
    5. func main() { 
    6.     app := iris.New() 
    7.     app.Controller("/api/values/{id}", new(controllers.ValuesController)) 
    8.     app.Run(iris.Addr(":5000"), iris.WithoutVersionChecker) 
    1. package controllers 
    2. import "github.com/kataras/iris/mvc" 
    3. // ValuesController is the equivalent 
    4. // `ValuesController` of the .net core 2.0 mvc application. 
    5. type ValuesController struct { 
    6.     mvc.Controller 
    7. // Get handles "GET" requests to "api/values/{id}"
    8. func (vc *ValuesController) Get() { 
    9.     // id,_ := vc.Params.GetInt("id"
    10.     vc.Ctx.WriteString("value"
    11. // Put handles "PUT" requests to "api/values/{id}"
    12. func (vc *ValuesController) Put() {} 
    13. // Delete handles "DELETE" requests to "api/values/{id}"
    14. func (vc *ValuesController) Delete() {} 
    1. package main 
    2. import ( 
    3.     "github.com/kataras/iris/_benchmarks/iris-mvc-templates/controllers" 
    4.     "github.com/kataras/iris" 
    5.     "github.com/kataras/iris/context" 
    6. const ( 
    7.     // templatesDir is the exactly the same path that .NET Core is using for its templates, 
    8.     // in order to reduce the size

        推荐阅读

        SQL Server 2017正式发布;Oracle宣布开源Fn project

      SQL Server 2017 正式宣布:同时支撑 Windows 和 Linux微软在客岁 3 月初次对外宣布了 Linux 版的 SQL Server,痊愈本年 7 月宣布了首个公开 RC 版。前几日在美国奥兰多召开的微软 Ignit>>>详细阅读


      本文标题:论HTTP性能,Go与.NET Core一争雌雄

      地址:http://www.17bianji.com/lsqh/37756.html

    关键词: 探索发现

    乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

    网友点评
    自媒体专栏

    评论

    热度

    精彩导读
    栏目ID=71的表不存在(操作类型=0)