HTTPListener vs Native HTTP performance

前端 未结 1 926
后悔当初
后悔当初 2021-02-08 21:28

Quick Background: I understand that HTTPListener uses http.sys kernel driver which supposedly makes it a great performer. However, when doing some performance benchmarks between

相关标签:
1条回答
  • 2021-02-08 21:42

    The fact that it uses Http.sys doesn't mean that there isn't a native-to-managed transition. From the above-mentioned MSDN article:

    HTTP.sys provides connection management, bandwidth throttling, and Web server logging.

    By virtue of the fact that you are running managed code, you have interop (native to managed, not to be confused with COM interop), you have garbage collection, etc. It's never going to be as fast as a pure native c++ implementation.

    EDIT: To make this clearer, you are still running a .NET process, you are just hooking into IIS in kernel mode, not in user mode. A great article on this is here: http://www.west-wind.com/presentations/howaspnetworks/howaspnetworks.asp

    0 讨论(0)
提交回复
热议问题