justintv / Twitch-API

A home for details about our API
www.twitch.tv
1.72k stars 381 forks source link

[Not an Issue] 300-1000 miliseconds to pull 50 streams with GSON. #634

Closed CyberSecGuy closed 7 years ago

CyberSecGuy commented 7 years ago

Just curious if there is any faster way to pull json data. I am writing a java program using GSON library to pull down, for testing, 50 channels. Checking a time stamp difference I am getting about 300-600ms per pull, outliers include as low as 250ms and as high as 1300ms.

bashtech commented 7 years ago

That's about what I see on /streams requests which is generally fine since you should not be sending more than 1 request per second anyway:

curl -w "@curl-format.txt" -o /dev/null -s "https://api.twitch.tv/kraken/streams/bobross?client_id=XXX"
time_namelookup:  0.004
       time_connect:  0.092
    time_appconnect:  0.274
   time_pretransfer:  0.274
      time_redirect:  0.000
 time_starttransfer:  0.367
                    ----------
         time_total:  0.367
CyberSecGuy commented 7 years ago

Cool beans bud! Thanks for the reply!