Message406341
Turns out for n=100_000, k=50_000, about 87% of my factors are 1, so they don't even need to be turned into Python ints for multiplication, improving the multiplication part to 3.05 ms. And a C++ version to produce the factors took 0.85 ms. Updated estimation:
1510.4 ms math.comb(n, k)
460.8 ms factorial(n) // (factorial(k) * factorial(n-k))
3.9 ms *estimation* for mycomb if written in C |
|
Date |
User |
Action |
Args |
2021-11-15 06:31:45 | Stefan Pochmann | set | recipients:
+ Stefan Pochmann, tim.peters, rhettinger, mark.dickinson, serhiy.storchaka, PedanticHacker, mcognetta, pablogsal |
2021-11-15 06:31:45 | Stefan Pochmann | set | messageid: <1636957905.14.0.983462022187.issue37295@roundup.psfhosted.org> |
2021-11-15 06:31:45 | Stefan Pochmann | link | issue37295 messages |
2021-11-15 06:31:45 | Stefan Pochmann | create | |
|