c# - Windows Phone HttpClient GetAsync performance -


i'm working twitch rest api education purposes(mvvm pattern) on windows phone platform. noticed pure performance while using httpclient:

  1. i collection of 10 elements
  2. pass checkcannelstreamstatus

i removed code because draft prototype.

like in answer bellow problem in httpclient.getasync resulted in ~671ms execution time.

this has nothing "performance" of httpclient. reason rather you're going 10 times server information. that'll ~768ms per request, sounds reasonable given latency. there's little httpclient can latency , server response times.

to verify case, suggest pop fiddler or similar tool make sure response time offender. wrap both client.getasync , response.content.readasasync<twitchstream>() in separate stopwatches , verify serialization not root cause here.

to decrease time takes needed information, i'd suggest executing http requests in parallel. httpclient designed both reused both multiple calls, , across multiple threads. reusing single instance , executing multiple requests in parallel, using task.whenall or similar, make perform better.


Comments