MagicStack / MagicStack/uvloop

Uvloop internal clock is not microsecond accurate

Open
#359 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

libuv
Dominant language
Cython
Stars
11.9k
Forks
616
PR merge metrics
No merged PRs in 30d

Description

  • uvloop version: 0.14, master
  • Python version: 3.6
  • Platform: Linux
  • Can you reproduce the bug with PYTHONASYNCIODEBUG in env?: yes
  • Does uvloop behave differently from vanilla asyncio? How?: loop.time() reports time with the accuracy of milliseconds on uvloop, microseconds (or greater) on the stdlib event loop.

Today I debugged some failing tests in the httpcore project and it turns out they were relying on time passing between two subsequent operations. The code was running so fast, however, that the returned clock value on uvloop was the same as it was before, due to the lesser accuracy. This should hopefully be easy to fix.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported comparison of uvloop's loop.time() with vanilla asyncio on Linux using Python 3.6, then trace the event-loop clock implementation in uvloop. Done means successive fast operations report microsecond-level timing comparable to the stdlib event loop, with a regression test covering the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.