Repository navigation
Closed
Labels
Milestone
Description
This problem is magnified on gh-30995 because the RISC-V cores aren't all that performant (~10x slower than my M1 Macbook), however there are a lot of tests that are failing our design rule - which isn't super crisply written down I believe - of tests having to be marked as slow if they exceed 0.5 sec (maybe we've used 1 sec. in the past, but not more than that), unless there's a good reason not to.
Here are the 40 slowest tests I observe right now on a default spin test on an M1 Macbook:
====================================================================== slowest 40 durations =======================================================================
4.23s setup build-install/usr/lib/python3.14/site-packages/numpy/_core/tests/test_cython.py::test_is_timedelta64_object
4.02s setup build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_array_from_pyobj.py::TestIntent::test_in_out
3.44s setup build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_parameter.py::TestParameters::test_constant_array
3.42s setup build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_data.py::TestDataWithCommentsF77::test_data_stmts
3.40s setup build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_isoc.py::TestISOC::test_bindc_function
3.38s setup build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_data.py::TestDataF77::test_data_stmts
3.38s setup build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_character.py::TestMiscCharacter::test_gh6308
3.36s setup build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_data.py::TestData::test_crackedlines
3.34s setup build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_crackfortran.py::TestDimSpec::test_inv_array_size[n]
3.34s setup build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_string.py::TestDocStringArguments::test_example
3.33s setup build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_callback.py::TestF77CallbackPythonTLS::test_docstring
3.30s setup build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_callback.py::TestGH25211::test_gh25211
3.30s setup build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_kind.py::TestKind::test_int
3.29s setup build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_f2cmap.py::TestF2Cmap::test_gh15095
3.28s setup build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_crackfortran.py::TestCrackFortran::test_gh2848
3.28s setup build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_callback.py::TestF77Callback::test_docstring
3.25s setup build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_character.py::TestStringScalarArr::test_char
3.24s setup build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_mixed.py::TestMixed::test_docstring
3.24s setup build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_data.py::TestDataMultiplierF77::test_data_stmts
3.23s setup build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_character.py::TestCharacter::test_input[c]
3.22s setup build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_string.py::TestFixedString::test_intent_in
3.21s setup build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_character.py::TestStringAssumedLength::test_gh24008
3.21s setup build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_crackfortran.py::TestNoSpace::test_module
3.17s setup build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_crackfortran.py::TestExternal::test_external_as_statement
3.17s setup build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_common.py::TestCommonWithUse::test_common_gh19161
3.14s call build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_f2py2e.py::test_latex_doc_gh30268
2.90s setup build-install/usr/lib/python3.14/site-packages/numpy/_core/tests/test_limited_api.py::test_limited_api
2.77s call build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_f2py2e.py::test_no_distutils_backend
2.76s call build-install/usr/lib/python3.14/site-packages/numpy/f2py/tests/test_f2py2e.py::test_untitled_cli
2.42s call build-install/usr/lib/python3.14/site-packages/numpy/testing/tests/test_utils.py::TestAssertNoGcCycles::test_asserts
2.38s call build-install/usr/lib/python3.14/site-packages/numpy/tests/test_ctypeslib.py::TestAsArray::test_reference_cycles
2.33s call build-install/usr/lib/python3.14/site-packages/numpy/testing/tests/test_utils.py::TestAssertNoGcCycles::test_passes
2.16s call build-install/usr/lib/python3.14/site-packages/numpy/lib/tests/test_function_base.py::TestLeaks::test_frompyfunc_leaks[bound-20]
2.13s call build-install/usr/lib/python3.14/site-packages/numpy/linalg/tests/test_regression.py::TestRegression::test_openblas_threading
2.10s call build-install/usr/lib/python3.14/site-packages/numpy/lib/tests/test_io.py::test_load_refcount
2.00s setup build-install/usr/lib/python3.14/site-packages/numpy/_core/tests/test_mem_policy.py::test_set_policy
1.94s call build-install/usr/lib/python3.14/site-packages/numpy/lib/tests/test_function_base.py::TestLeaks::test_frompyfunc_leaks[unbound-0]
1.78s call build-install/usr/lib/python3.14/site-packages/numpy/lib/tests/test_function_base.py::TestPercentile::test_percentile_gh_29003_Fraction
1.24s call build-install/usr/lib/python3.14/site-packages/numpy/tests/test_public_api.py::test_all_modules_are_expected_2
0.87s call build-install/usr/lib/python3.14/site-packages/numpy/_core/tests/test_multiarray.py::TestPickling::test_roundtrip
Almost all of these are compile tests or special-purpose tests like GC checks or pickling roundtrips. There is no good reason for most of these to not be marked as slow.
I'll open a PR.
Activity
rgommers commentedon May 13, 2026
One constraint is that we need some test coverage for
cythonandf2pyin the default test suite, so it needs a couple of compile tests. Same for pickling and multi-threaded tests. That can be sparse coverage though; we have a lot of'full'test coverage in CI (1-2 jobs per platform), and CI exists for a reason.Keeping that constraint in mind and then applying slow markers relatively liberally, we can get to a result like this (timing on M5 Macbook, all tests about 0.15 sec.):
Total test time for
spin testis then ~45 sec. on M5, so should be about 1.5 minute on M1 and 2-3 minutes on x86-64.mattip commentedon May 13, 2026
+1 for making the fast tests fast.