ASP.NET Request.Form Performance

前端 未结 3 1324
情深已故
情深已故 2020-12-29 12:13

I used a HttpHandler to implement a light-weight web service targeted for high performance. It requires a POST with content-type application

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-29 12:33

    The

    System.Web.Hosting.UnsafeIISMethods.MgdSyncReadRequest()
    

    is an imported IIS function (as you may have guessed). Since http.sys, the bit that does all the http work for IIS, is unmanaged code, at some point your application will need to talk to it, although not directly.

    What I guess is happening is when you read the form collection, .net is reading this from the raw request from IIS. If it's proving to be a bottle neck, I would refactor your code to read the form data asynchronously and store the values you need in a native data structure.

    Simon

提交回复
热议问题