question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUG: hypergeom.cdf slower in 1.8.0 than 1.7.3

See original GitHub issue

Describe 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:open
  • Created a year ago
  • Comments:16 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
bgyoricommented, Nov 4, 2022

@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.

0reactions
mdhabercommented, Dec 10, 2022

No problem! That would be terrific. (At some point I should really learn to run simple Boost stuff in C++…)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found