Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bugfix and simplification in TimeService
The main bug was that ceil was called on time returned by loop.time() before being used to schedule the next iteration of the callback that updated the TimeService. The TimeService was then incrementing its stored time by one second. This resulted in the time being updated by one second about every 1.5 seconds, quickly causing it to fall behind. There was code to reset TimeService's internal time every 10 minutes, but that has been removed. Benchmarking has shown that just calling time.time() has no statistically valid performance difference than the code that checked for the need to reset. Even if it were slightly slower, it is only called once per second. Also, the counter that was used to compare to the reset limit was never incremented, so the reset never actually ever happened. I was tempted to remove the properties for accessing time and loop time, as time.time() and loop.time() are not expensive calls. But I didn't want to break the API for anyone using this. The only significant performance gain I was able to find was with strtime. My use case doesn't push aiohttp very hard, so I can't replicate whatever performance issue TimeService was intended to solve.
- Loading branch information