python-trio / python-trio/trio
use a heap instead of sorteddict?
Open
Nobody has claimed this yet.
performance
- Dominant language
- Python
- Stars
- 7.3k
- Forks
- 431
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 6
Description
I see trio depends on sortedcontainers solely because it needs a priority queue for sorting deadlines and the similar, and the Python standard library has one (heapq) for that exact purpose.
Pros:
- one less dependency
- it's (at least) slightly faster (13.29s vs 12.97s running the tests; it varies but the fastest sortedcontainers one took the same time as the slowest heap one)
Cons:
- may introduce bugs
- I have only a rough implementation, need some work to send a pull request
What do you think?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating Trio's deadline priority queue and the sortedcontainers dependency, then read the heapq documentation linked in the issue. Compare the rough heap implementation with the existing behavior and run the test suite; done means the dependency can be removed without regressions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100