Description
Switch uasyncio to wrap-around time source like utime.ticks_ms(), as required for baremetal ports, requires changing to the comparison done in uheapq module - it should use partial ordering definable for modular arithmetic (ring math object). So, that requires changing uheapq anyway, and I currently have adhoc changes for that coded.
Besides this must-have feature, there're also change to optimize:
- Pre-allocate queue of some size.
- Avoid constant packing and unpacking of tuples as done now.
So, that actually calls for introduction of adhoc heap queue class implementation for uasyncio. The main question is how to implement it - I consider turning current moduheapq.c into header with poor-man's templating implementation to teach it working with different data structures. Any objections?
After this changes, there will be (in a common case) the only remaining source of memory traffic for uasyncio usage - constant generator creation from yield from.