It took me around 1 hour to create a very inefficient script in Python that processes a
.fit file and obtains the normalized power, plus the best average for 15 seconds, 1 minute, 5 minutes and 20 minutes. When used, it looks something like this:
~/workspace/fit_process ❯ ./fit_process --file 2020-12-31-15-21-37.fit Normalized power: 214W 15 seconds: 341W 1 minute: 313W 5 minute: 307W 20 minute: 298W
Now, believe me when I tell you it’s very inefficient, because I wanted something quick and dirty to have a rough idea.
The script in the example took a little less than 2 seconds, and the full workout was a little longer than 1 hour. My home computer has 12 cores, which (more or less) means I can process 12 similar
.fit files every second. With this, I could process a full race with 240 riders in 40 seconds, or a ride with 1,000 riders in 3 minutes. And that’s with a single server.
Oh, and did I mention how inefficient this is? I’m repeating some calculations to save me the trouble of writing extra lines of code. An optimized version would take a fraction of the time. But again, it only took me one hour to write.
Of course Zwiftpower does more, like writing these results to a database, but next time they take hours or even days to report results, this will put the delay in perspective.
I’m planning to share the script, ugly and inefficient as it is, as soon as I make some small improvements to see how much better it can be if I put some thought and dedicate some more time to it.