faster C++ .NET webclient usage?
-
The code below takes a few seconds for each thread/webpage, which is longer than accessing it from an open browser such as google chrome. Is there some setting I need to apply to make it run faster? Should I try to reuse the same webclient in each thread and consider using DownloadAsync? I am thinking that webclient might internally use technology from the slow browser internet explorer instead of google chrome for instance. Is there a public API that would let me download this with google chrome. System::Net::WebClient client; client.DownloadString(URL); //URL is a System::String^
-
The code below takes a few seconds for each thread/webpage, which is longer than accessing it from an open browser such as google chrome. Is there some setting I need to apply to make it run faster? Should I try to reuse the same webclient in each thread and consider using DownloadAsync? I am thinking that webclient might internally use technology from the slow browser internet explorer instead of google chrome for instance. Is there a public API that would let me download this with google chrome. System::Net::WebClient client; client.DownloadString(URL); //URL is a System::String^
Ted2102 wrote:
which is longer than accessing it from an open browser such as google chrome.
That's an unfair comparison; the piece of code will always fetch the page as it is on the server, where Chrome can simply read back it's own cache.
Ted2102 wrote:
consider using DownloadAsync?
That wouldn't fetch the page faster, it would only move the task to another thread. You'd still have to wait until that thread receives the entire response.
Ted2102 wrote:
Is there a public API that would let me download this with google chrome.
Alas, no.
I are Troll :suss:
-
Ted2102 wrote:
which is longer than accessing it from an open browser such as google chrome.
That's an unfair comparison; the piece of code will always fetch the page as it is on the server, where Chrome can simply read back it's own cache.
Ted2102 wrote:
consider using DownloadAsync?
That wouldn't fetch the page faster, it would only move the task to another thread. You'd still have to wait until that thread receives the entire response.
Ted2102 wrote:
Is there a public API that would let me download this with google chrome.
Alas, no.
I are Troll :suss: