Open dbrakenhoff opened 1 month ago
Comparison on my PC between Python 3.12 and Python 3.11:
Execution time of notebook running in VS code (timed using timeit.default_timer()
): 9.260451770000145
Running jupyter nbconvert
directly in shell: 9s
Pytest (trying two different methods of executing notebooks):
Test session starts (platform: linux, Python 3.12.6, pytest 8.3.3, pytest-sugar 1.0.0)
...
================================== slowest durations ===================================
23.74s call tests/test_well_near_wall.py::test_well_near_wall_cmd
18.51s call tests/test_well_near_wall.py::test_well_near_wall_py
(4 durations < 0.005s hidden. Use -vv to show these durations.)
Results (45.67s):
2 passed
Execution time of notebook running in VS code (timed using timeit.default_timer()
): 9.472318610999537
Running jupyter nbconvert
directly in shell: 9s
Pytest (trying two different methods of executing notebooks):
Test session starts (platform: linux, Python 3.11.10, pytest 8.3.3, pytest-sugar 1.0.0)
...
================================== slowest durations ===================================
18.35s call tests/test_well_near_wall.py::test_well_near_wall_py
16.00s call tests/test_well_near_wall.py::test_well_near_wall_cmd
(4 durations < 0.005s hidden. Use -vv to show these durations.)
Results (36.50s):
2 passed
Pytest seems to cause a ~2x slow-down in running the notebook for some reason, and the slow down is worse in Python 3.12.
The same notebook I mentioned above in GH actions:
But there is no performance issue for TTim in Python 3.12, it is specifically related to pytest.
Timing from github actions. Something worth investigating...