Python script speed upgrade - version 1.1
With the addition of the streak badges and expeditions to the challenge page the data upload is getting really slow. For me it takes over a minute to run the script, I timed it to 68-78 seconds. The main reason is of course the number of extra request that must be sent to Garmin. The script is doing that in series which takes forever since each request must return before the next is made.
The solution is called parallelism. Send all the requests at the same time (more or less). The Python script is now updated and sends up to 10 requests at the same time. I had to limit the number of requests due to the size of the thread pool and I do not want to mess to much with the thread pool settings. Keep it simple!
The time for the new updated script is: 14 seconds! About 5 times faster than the old script.
The time will be a little different every time and sometimes it will take longer time due to internet traffic and server load, but it will be about 4-5 times faster than the old script.
1.1 Added threading to speed it up.
1.0 First release
Link to the script (Same path as before. Refresh the page and make sure it says version 1.1 at the top.)
The Chrome extension will hopefully also get an update with threading soon. I just have to figure out how to do it :-)