This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients onethreeseven, python-dev, rhettinger
Date 2021-12-04.18:38:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1638643096.55.0.413546350552.issue45976@roundup.psfhosted.org>
In-reply-to
Content
Notes
=====

Without Boundmethod
-------------------
  LOAD FAST self
  LOAD METHOD getrandbits
  LOAD FAST k
  CALL_METHOD 1

Form Boundmethod
----------------
   LOAD FAST self
   LOAD ATTR getrandbits
   STORE FAST getrandbits

Call Boundmethod
----------------
   LOAD FAST getrandbits
   LOAD FAST k
   CALL FUNCTION 1

Expected Call Frequency
-----------------------

n = 1000
r = 0 .. 1024
P(r > n) 24 / 1024 = 2.3%
E[calls] = 1 / (1 - 24/1024) = 1.024

n = 1024
r = 0 .. 2048
P(r > n) = 1024 / 2048 = 50%
E[calls] = 1 / (1 - 1024/2048) = 2.0
History
Date User Action Args
2021-12-04 18:38:16rhettingersetrecipients: + rhettinger, python-dev, onethreeseven
2021-12-04 18:38:16rhettingersetmessageid: <1638643096.55.0.413546350552.issue45976@roundup.psfhosted.org>
2021-12-04 18:38:16rhettingerlinkissue45976 messages
2021-12-04 18:38:16rhettingercreate