New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster ParkingLot #287

merged 1 commit into from Aug 21, 2017


None yet
1 participant

njsmith commented Aug 15, 2017

See gh-272 for context.

Simplify and speed up ParkingLot
Use OrderedDict instead of SortedDict, and don't make park() pay for

See gh-272 for context. This doesn't make ParkingLot as fast as a
version that just holds a set of tasks and does

  def unpark_all(self):
      while self._waiters:

  def unpark(self):
      if self._waiters:

but it's about half-way in between the old version and this minimal
version on the broker microbenchmark.

This comment has been minimized.

codecov bot commented Aug 15, 2017

Codecov Report

Merging #287 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #287      +/-   ##
- Coverage   99.13%   99.13%   -0.01%     
  Files          76       76              
  Lines        9269     9266       -3     
  Branches      655      654       -1     
- Hits         9189     9186       -3     
  Misses         62       62              
  Partials       18       18
Impacted Files Coverage Δ
trio/_core/ 100% <ø> (ø) ⬆️
trio/_core/ 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 82ca55c...9cc3477. Read the comment docs.

@njsmith njsmith changed the title from [wip] Speeding up synchronization primitives to Faster ParkingLot Aug 21, 2017


This comment has been minimized.


njsmith commented Aug 21, 2017

I wanted to get a queue rewrite in here as well, but I want to get 0.2.0 out even more, so I'm going to put in the ParkingLot changes alone and defer the Queue part until later.

@njsmith njsmith merged commit 8adfa4d into python-trio:master Aug 21, 2017

4 checks passed

codecov/patch 100% of diff hit (target 99.13%)
codecov/project Absolute coverage decreased by -<.01% but relative coverage increased by +0.86% compared to 82ca55c
continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed

@njsmith njsmith deleted the njsmith:faster-parkinglot-queue-queue branch Aug 21, 2017

njsmith added a commit to njsmith/trio that referenced this pull request Aug 21, 2017

Run yapf
Fixes a formatting problem that snuck in with python-triogh-287, whose CI ran
before we added the formatting checks, but then was merged after.

@njsmith njsmith referenced this pull request Aug 21, 2017


Run yapf #301

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment