Skip to content

Conversation

@adriencaccia
Copy link
Member

Fix #86

This is still a work in progress, it must be tested thoroughly in CI to ensure that it plays well with free-threaded versions of Python, using UV or not.

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 28, 2025

CodSpeed Performance Report

Merging #96 will degrade performances by 16.5%

Comparing feat/remove-cffi (33c1bfa) with master (a71ec50)

Summary

⚡ 60 improvements
❌ 20 regressions
✅ 87 untouched

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Mode Benchmark BASE HEAD Change
Simulation test_iir_filter_process 35.3 µs 32.7 µs +8%
WallTime test_iir_filter_set_coefficients[a_coeffs0-b_coeffs0] 818.9 ns 848 ns -3.43%
Simulation test_iir_filter_set_coefficients[a_coeffs0-b_coeffs0] 16.7 µs 13.9 µs +20.2%
Simulation test_make_allpass 46.6 µs 43.8 µs +6.5%
WallTime test_make_bandpass 5.3 µs 5.6 µs -5.47%
Simulation test_make_bandpass 47.3 µs 44.2 µs +6.97%
Simulation test_make_highpass 47.2 µs 44.3 µs +6.64%
Simulation test_make_highshelf 46.3 µs 43.5 µs +6.49%
Simulation test_make_lowpass 47.3 µs 44.3 µs +6.66%
Simulation test_make_lowshelf 46.4 µs 43.4 µs +6.82%
WallTime test_make_lowshelf 7.3 µs 7 µs +3.81%
Simulation test_make_peak 43.3 µs 40.8 µs +6.11%
WallTime test_color[graph0-3] 27.2 µs 26.4 µs +2.92%
Simulation test_color[graph0-3] 76.7 µs 73.9 µs +3.78%
Simulation test_combination_lists[0-0] 26.5 µs 23.8 µs +11.04%
Simulation test_combination_lists[4-2] 31.2 µs 28.6 µs +9.13%
WallTime test_combination_lists[4-2] 3.8 µs 3.7 µs +2.41%
Simulation test_combination_lists[5-4] 31.5 µs 28.7 µs +9.53%
Simulation test_combination_sum[candidates0-8] 43.7 µs 40.8 µs +7.07%
WallTime test_combination_sum[candidates0-8] 10.6 µs 11.1 µs -4.03%
... ... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

@Vizonex
Copy link

Vizonex commented Oct 29, 2025

Fix #86

This is still a work in progress, it must be tested thoroughly in CI to ensure that it plays well with free-threaded versions of Python, using UV or not.

Sounds good. I can't wait to see if this will pass on through or not.

@adriencaccia
Copy link
Member Author

Sounds good. I can't wait to see if this will pass on through or not.

It seems that there is an issue when running CODSPEED_LOG=debug codspeed --mode instrumentation -- uv run pytest tests/ --codspeed with python3.14t
Here is the error:

Fatal Python error:   ⠠ Running the benchmarks...                                                                                                                                                                                                                                                                      
preconfig_init_allocator:   ⠠ Running the benchmarks...                                                                                                                                                                                                                                                                
PYTHONMALLOC: unknown allocator
Python runtime state:   ⠠ Running the benchmarks...                                                                                                                                                                                                                                                                    
preinitializing  ⠠ Running the benchmarks...                                                                                                                                                                                                                                                                           


Stack (most recent call first):
  <tstate is freed>

In the runner we are setting the following:
https://github.com/CodSpeedHQ/runner/blob/e89b00befed092f3300c89b9f6577a00e025c944/src/run/runner/valgrind/measure.rs#L91

Do you know if there is any issue with free-threaded python and using PYTHONMALLOC?

@Vizonex
Copy link

Vizonex commented Oct 30, 2025

Sounds good. I can't wait to see if this will pass on through or not.

It seems that there is an issue when running CODSPEED_LOG=debug codspeed --mode instrumentation -- uv run pytest tests/ --codspeed with python3.14t Here is the error:

Fatal Python error:   ⠠ Running the benchmarks...                                                                                                                                                                                                                                                                      
preconfig_init_allocator:   ⠠ Running the benchmarks...                                                                                                                                                                                                                                                                
PYTHONMALLOC: unknown allocator
Python runtime state:   ⠠ Running the benchmarks...                                                                                                                                                                                                                                                                    
preinitializing  ⠠ Running the benchmarks...                                                                                                                                                                                                                                                                           


Stack (most recent call first):
  <tstate is freed>

In the runner we are setting the following: https://github.com/CodSpeedHQ/runner/blob/e89b00befed092f3300c89b9f6577a00e025c944/src/run/runner/valgrind/measure.rs#L91

Do you know if there is any issue with free-threaded python and using PYTHONMALLOC?

@adriencaccia Sorry for my rather late response but there is one called PyMem_RawMalloc which can be ran without the gil same with PyMem_RawFree, PyMem_RawRealloc, PyMem_RawCalloc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

python 3.13 on free-threaded mode doesn't work

4 participants