[C #] WebClient performance optimization,
By default, WebClient is for security and convenience, not for performance. Therefore, when you plan to perform a stress test, you will find that the WebClient is slow.
The performance of WebClient is poor mainly because:
1. It uses the proxy settings of IE by default, while the proxy settings of IE are 'autocheck' by default '. This means that each process automatically detects a proxy when using WebClient for the first time, which usually takes more than five seconds.
2. The WebClient follows an old spam setting "Only two concurrent connections can be initiated for each website"
Therefore, you can optimize the performance of the WebClient as follows:
1. WebClient. Proxy = null. Disable proxy.
2. ServicePointManager. DefaultConnectionLimit = 500;
In addition, ServicePointManager also has several attributes that may affect performance: Expect100Continue, UseNagleAlgorithm, and CheckCertificateRevocationList.
It is really troublesome to use WebClient.
Is there a simple class library like curl?