BUG: hypergeom.cdf slower in 1.8.0 than 1.7.3
See original GitHub issueDescribe your issue.
While using the fisher_exact
test in a loop on some 2x2 tables, I noticed a significant slowdown between Scipy versions 1.7.3 and 1.8.0 (1.8.0 is about 20x slower than 1.7.3). I narrowed it down to the call to hypergeom.cdf
, and found a specific set of arguments with which the slowdown can be reproduced (see code example below).
Reproducing Code Example
import time
import scipy
from scipy.stats import distributions
ts = time.time()
for _ in range(10000):
distributions.hypergeom.cdf(0, 48127, 57, 35775)
te = time.time()
print(scipy.__version__, '%.2fs' % (te-ts))
# Output for version info 1.7.3 1.22.2 sys.version_info(major=3, minor=8, micro=10, releaselevel='final', serial=0)
# 1.7.3 1.84s
# Output for version info 1.8.0 1.22.2 sys.version_info(major=3, minor=8, micro=10, releaselevel='final', serial=0)
# 1.8.0 41.11s
Error message
-
SciPy/NumPy/Python version information
1.8.0 1.22.2 sys.version_info(major=3, minor=8, micro=10, releaselevel=‘final’, serial=0)
Issue Analytics
- State:
- Created a year ago
- Comments:16 (11 by maintainers)
Top Results From Across the Web
SciPy 1.6.0 Release Notes — SciPy v1.9.3 Manual
SciPy 1.6.0 is the culmination of 6 months of hard work. It contains many new features, numerous bug-fixes, improved test coverage and better...
Read more >SciPy 0.18.0 Release Notes
SciPy 0.18.0 is the culmination of 6 months of hard work. It contains many new features, numerous bug-fixes, improved test coverage and better...
Read more >Bioconductor 2.12 is released
The model is based on counting paths across exons, rather than pairwise exon ... Changes in version 1.30.2 (2013-01-07): - BUG FIX: writeCdf()...
Read more >gretl changelog - SourceForge
... 1.8.4 Version 1.8.3 Version 1.8.2 Version 1.8.1 Version 1.8.0 Version 1.7.9 ... via mread() was much slower than necessary for large matrices...
Read more >Writing R Extensions
In particular, packages providing “only” data for examples or vignettes should be listed in ' Suggests ' rather than ' Depends ' in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@cthoyt The issue I reported above was primiarily on Ubuntu and we determined it to be Boost-related. I confirmed that updating the scipy version to 1.9.3 alone does not change it.
No problem! That would be terrific. (At some point I should really learn to run simple Boost stuff in C++…)