The Wayback Machine - https://web.archive.org/web/20211019085205/https://github.com/python/cpython/pull/29012
Skip to content
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

Improve multiserver queue recipe #29012

Merged
merged 2 commits into from Oct 17, 2021

Conversation

@rhettinger
Copy link
Contributor

@rhettinger rhettinger commented Oct 17, 2021

  • A million iterations is reasonably fast but gives more consistent simulation results than a shorter run.
  • The heapreplace() function does less work than a heappop() followed by a heappush().
  • The service duration is normally distributed but can never be negative.
  • The initial servers list must be arranged as a heap.
@rhettinger rhettinger merged commit 54a4e1b into python:main Oct 17, 2021
12 checks passed
@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Oct 17, 2021

Thanks @rhettinger for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10.
🐍🍒🤖

@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Oct 17, 2021

GH-29013 is a backport of this pull request to the 3.10 branch.

@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Oct 17, 2021

GH-29014 is a backport of this pull request to the 3.9 branch.

miss-islington added a commit to miss-islington/cpython that referenced this issue Oct 17, 2021
(cherry picked from commit 54a4e1b53a18f0c7420ba03de9608194c4413fc2)

Co-authored-by: Raymond Hettinger <[email protected]>
miss-islington added a commit to miss-islington/cpython that referenced this issue Oct 17, 2021
(cherry picked from commit 54a4e1b53a18f0c7420ba03de9608194c4413fc2)

Co-authored-by: Raymond Hettinger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants