Author Stefan Pochmann
Recipients PedanticHacker, Stefan Pochmann, mark.dickinson, mcognetta, pablogsal, rhettinger, serhiy.storchaka, tim.peters
Date 2021-11-15.04:56:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1636952180.87.0.787468443756.issue37295@roundup.psfhosted.org>
In-reply-to
Content
And for Raymond's case 4), about running very long and not responding to SIGINT, with n=1_000_000 and k=500_000:

150.91 seconds  math.comb(n, k)
 39.11 seconds  factorial(n) // (factorial(k) * factorial(n-k))
  0.40 seconds  mycomb(n, k)
  0.14 seconds  *estimation* for mycomb if written in C

And for n=10_000_000 and k=5_000_000:

   ~4 hours    *estimation* for math.comb(n, k)
   ~1 hour     *estimation* for factorials solution
  8.3 seconds  mycomb(n, k)
  4.5 seconds  *estimation* for mycomb if written in C
History
Date User Action Args
2021-11-15 04:56:20Stefan Pochmannsetrecipients: + Stefan Pochmann, tim.peters, rhettinger, mark.dickinson, serhiy.storchaka, PedanticHacker, mcognetta, pablogsal
2021-11-15 04:56:20Stefan Pochmannsetmessageid: <1636952180.87.0.787468443756.issue37295@roundup.psfhosted.org>
2021-11-15 04:56:20Stefan Pochmannlinkissue37295 messages
2021-11-15 04:56:20Stefan Pochmanncreate