WCF streaming mode is really slow

北城以北 提交于 2019-12-24 11:36:07

问题


I want to know why WCF in streaming mode is really slow compared to the buffered mode.

Basically, I'm reading a lot of data from a server (database access) then transferring that huge data through WCF to other clients.

I was doing some tests and benchmarks by comparing the 2 different transfer modes.

I created 2 endpoints. The first one is using transferMode="Buffered" and the other one is using transferMode="StreamedResponse".

By loading the same 1 millions rows from a SQL server (Dummy table), here are the results:

  • Buffered: 20447 milliseconds.
  • Streaming: 109417 milliseconds.

The streaming is done like in that Q/A. Basically, the data is stored in an IEnumerable<T> and then streamed to the client that consumes it.

I can provide the WCF app.config files if needed.

By the way, I already had a look on other similar questions like those:

WCF NetTcpBinding Buffered vs Streamed performance problems

But they don't really give an appropriate answer.

来源:https://stackoverflow.com/questions/52085812/wcf-streaming-mode-is-really-slow

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!