Repository navigation
test_math.test_sumprod_stress() takes 5 minutes on debug build #110327
Description
Activity
Timings as JUnit XML of
./python -m test test_math -v --junit-xml=results-all.xml -u all: results-all.xml.txt (5 min 28 sec).Timings as JUnit XML of ./python -m test test_math -v --junit-xml=results-all.xml -u all: results-all.xml.txt (5 min 28 sec).
test_math.test_sumprod_stress() alone takes 5 min 13 sec. The test was added by issue GH-100485: commit 47b9f83.
test_math.test_sumprod_stress() alone takes 5 min 13 sec
This test uses 9 pools of lengths: [10, 9, 9, 11, 10, 9, 8, 5, 8]. It uses 4 nested loops for a total of 5,969,664 iterations.
IMO that's excessive and it should be possible to minimize the test to a few cases. I don't think that there is a need to test 5,969,664 cases.
@rhettinger @serhiy-storchaka: Can you please have a look at test_math.test_sumprod_stress() and see if we can test a few cases, rather than testing 5,969,664 cases?
On my laptop with Python built with
gcc -O0,./python -m test test_math -u alltakes 10 min 50 sec :-(- On Python built with
gcc -O3(./configure),./python -m test test_math -u all -v -m test_sumprod_stresstakes 25 seconds. - On Python built with
gcc -Og(./configure --with-pydebug),./python -m test test_math -u all -v -m test_sumprod_stresstakes 1 min 49 sec.
- On Python built with
Sorry, I don't know exactly what it is testing and what can be cut out without losing the value of the test.
if we can test a few cases, rather than testing 5,969,664 cases?
@vstinner,
test_sumprod_stress()should cover some lines, mentioned in #110000 (e.g. overflows for big integers), but I think at least in this function we could test only "exact" floats/ints, while mixed inputs could go to thetestSumProd().Well, apparently, other people don't care much, so let's leave it like that for now. If someone wants to propose a change, please open a new issue.
- changed the title
[-]Running test_math on PPC64LE Fedora Stable Clang 3.x takes 7 min 39 sec[/-][+]test_math.test_sumprod_stress() takes 5 minutes on debug build[/+]on Apr 11, 2024
On the " PPC64LE Fedora Stable Clang 3.x" with Python build by "/configure CC=clang LD=clang --with-pydebug", test_math takes 7 min 39 sec:
Can we split test_math into a test package made of multiple tests to run them in parallel?
Should we remove/skip some slow tests? Buildbot uses
--slow-ciwhich enables-u allresources.