Skip to content

Conversation

@shauneccles
Copy link

Introduce performance tests to verify that the Global Interpreter Lock (GIL) is released during resampling operations, enabling parallel execution in multi-threaded applications. The tests assess the performance improvements and output quality when using different converter types, thread counts and event loops.

@fakufaku fakufaku self-assigned this Nov 19, 2025
@shauneccles
Copy link
Author

shauneccles commented Nov 19, 2025

For reference this is current output on my machine
asyncio

PS C:\Users\shaun\python-samplerate-ledfx> uv run pytest tests/test_asyncio_performance.py -s
Uninstalled 1 package in 7ms
Installed 1 package in 23ms
================================================================ test session starts =================================================================
platform win32 -- Python 3.11.9, pytest-9.0.1, pluggy-1.6.0
rootdir: C:\Users\shaun\python-samplerate-ledfx
configfile: pyproject.toml
plugins: asyncio-1.3.0
asyncio: mode=Mode.STRICT, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collected 28 items                                                                                                                                    

tests\test_asyncio_performance.py
default loop - sinc_fastest async with ThreadPoolExecutor (2 concurrent):
  Sequential: 0.0499s
  Parallel: 0.0527s
  Speedup: 0.95x
  Platform: AMD64
  ⚠️  WARNING: Speedup 0.95x is below expected 1.1x
      This may be due to CI load or platform-specific threading overhead.
.
default loop - sinc_fastest async with ThreadPoolExecutor (4 concurrent):
  Sequential: 0.1063s
  Parallel: 0.1013s
  Speedup: 1.05x
  Platform: AMD64
  ⚠️  WARNING: Speedup 1.05x is below expected 1.2x
      This may be due to CI load or platform-specific threading overhead.
.
default loop - sinc_fastest async with ThreadPoolExecutor (8 concurrent):
  Sequential: 0.2039s
  Parallel: 0.2019s
  Speedup: 1.01x
  Platform: AMD64
  ⚠️  WARNING: Speedup 1.01x is below expected 1.2x
      This may be due to CI load or platform-specific threading overhead.
.
default loop - sinc_medium async with ThreadPoolExecutor (2 concurrent):
  Sequential: 0.0980s
  Parallel: 0.0984s
  Speedup: 1.00x
  Platform: AMD64
  ⚠️  WARNING: Speedup 1.00x is below expected 1.1x
      This may be due to CI load or platform-specific threading overhead.
.
default loop - sinc_medium async with ThreadPoolExecutor (4 concurrent):
  Sequential: 0.1956s
  Parallel: 0.1965s
  Speedup: 1.00x
default loop - sinc_medium async with ThreadPoolExecutor (8 concurrent):
  Sequential: 0.4028s
  Parallel: 0.3928s
  Speedup: 1.03x
  Platform: AMD64
  ⚠️  WARNING: Speedup 1.03x is below expected 1.2x
      This may be due to CI load or platform-specific threading overhead.
.
default loop - sinc_best async with ThreadPoolExecutor (2 concurrent):
  Sequential: 0.3047s
  Parallel: 0.3044s
  Speedup: 1.00x
  Platform: AMD64
  ⚠️  WARNING: Speedup 1.00x is below expected 1.1x
      This may be due to CI load or platform-specific threading overhead.
.
default loop - sinc_best async with ThreadPoolExecutor (4 concurrent):
  Sequential: 0.6116s
  Parallel: 0.6100s
  Speedup: 1.00x
  Platform: AMD64
  ⚠️  WARNING: Speedup 1.00x is below expected 1.2x
      This may be due to CI load or platform-specific threading overhead.
.
default loop - sinc_best async with ThreadPoolExecutor (8 concurrent):
  Sequential: 1.2147s
  Parallel: 1.2215s
  Speedup: 0.99x
  Platform: AMD64
  ⚠️  WARNING: Speedup 0.99x is below expected 1.2x
      This may be due to CI load or platform-specific threading overhead.
.
winloop loop - sinc_fastest async with ThreadPoolExecutor (2 concurrent):
  Sequential: 0.0500s
  Parallel: 0.0502s
  Speedup: 1.00x
  Platform: AMD64
  ⚠️  WARNING: Speedup 1.00x is below expected 1.1x
      This may be due to CI load or platform-specific threading overhead.
.
winloop loop - sinc_fastest async with ThreadPoolExecutor (4 concurrent):
  Sequential: 0.0994s
  Parallel: 0.0998s
  Speedup: 1.00x
  Platform: AMD64
  ⚠️  WARNING: Speedup 1.00x is below expected 1.2x
      This may be due to CI load or platform-specific threading overhead.
.
winloop loop - sinc_fastest async with ThreadPoolExecutor (8 concurrent):
  Sequential: 0.1986s
  Parallel: 0.2010s
  Speedup: 0.99x
  Platform: AMD64
  ⚠️  WARNING: Speedup 0.99x is below expected 1.2x
      This may be due to CI load or platform-specific threading overhead.
.
winloop loop - sinc_medium async with ThreadPoolExecutor (2 concurrent):
  Sequential: 0.0979s
  Parallel: 0.0984s
  Speedup: 0.99x
  Platform: AMD64
  ⚠️  WARNING: Speedup 0.99x is below expected 1.1x
      This may be due to CI load or platform-specific threading overhead.
.
winloop loop - sinc_medium async with ThreadPoolExecutor (4 concurrent):
  Sequential: 0.1959s
  Parallel: 0.1966s
  Speedup: 1.00x
  Platform: AMD64
  ⚠️  WARNING: Speedup 1.00x is below expected 1.2x
      This may be due to CI load or platform-specific threading overhead.
.
winloop loop - sinc_medium async with ThreadPoolExecutor (8 concurrent):
  Sequential: 0.3913s
  Parallel: 0.3931s
  Speedup: 1.00x
  Platform: AMD64
  ⚠️  WARNING: Speedup 1.00x is below expected 1.2x
      This may be due to CI load or platform-specific threading overhead.
.
winloop loop - sinc_best async with ThreadPoolExecutor (2 concurrent):
  Sequential: 0.3049s
  Parallel: 0.3045s
  Speedup: 1.00x
  Platform: AMD64
  ⚠️  WARNING: Speedup 1.00x is below expected 1.1x
      This may be due to CI load or platform-specific threading overhead.
.
winloop loop - sinc_best async with ThreadPoolExecutor (4 concurrent):
  Sequential: 0.6086s
  Parallel: 0.6119s
  Speedup: 0.99x
  Platform: AMD64
  ⚠️  WARNING: Speedup 0.99x is below expected 1.2x
      This may be due to CI load or platform-specific threading overhead.
.
winloop loop - sinc_best async with ThreadPoolExecutor (8 concurrent):
  Sequential: 1.2158s
  Parallel: 1.2171s
  Speedup: 1.00x
  Platform: AMD64
  ⚠️  WARNING: Speedup 1.00x is below expected 1.2x
      This may be due to CI load or platform-specific threading overhead.
.
default loop - sinc_fastest blocking vs executor:
  Without executor (blocks loop): 0.0100s
  With ThreadPoolExecutor: 0.0107s
  Improvement: 0.94x
  ⚠️  WARNING: Executor not significantly faster than blocking
      Expected executor < 0.0077s, got 0.0107s
      This may be due to CI load or platform-specific overhead.
.
winloop loop - sinc_fastest blocking vs executor:
  Without executor (blocks loop): 0.0099s
  With ThreadPoolExecutor: 0.0104s
  Improvement: 0.96x
  ⚠️  WARNING: Executor not significantly faster than blocking
      Expected executor < 0.0077s, got 0.0104s
      This may be due to CI load or platform-specific overhead.
.
default loop - 2 concurrent tasks - ThreadPool vs ProcessPool:
  ThreadPoolExecutor: 0.0204s
  ProcessPoolExecutor: 0.1688s
  Ratio: 8.29x
  → ThreadPool is faster
    (GIL release makes ThreadPool competitive with ProcessPool)
.
default loop - 4 concurrent tasks - ThreadPool vs ProcessPool:
  ThreadPoolExecutor: 0.0406s
  ProcessPoolExecutor: 0.1846s
  Ratio: 4.55x
  → ThreadPool is faster
    (GIL release makes ThreadPool competitive with ProcessPool)
.
winloop loop - 2 concurrent tasks - ThreadPool vs ProcessPool:
  ThreadPoolExecutor: 0.0202s
  ProcessPoolExecutor: 0.1658s
  Ratio: 8.21x
  → ThreadPool is faster
    (GIL release makes ThreadPool competitive with ProcessPool)
.
winloop loop - 4 concurrent tasks - ThreadPool vs ProcessPool:
  ThreadPoolExecutor: 0.0404s
  ProcessPoolExecutor: 0.1845s
  Ratio: 4.57x
  → ThreadPool is faster
    (GIL release makes ThreadPool competitive with ProcessPool)
.
default loop - Mixed I/O and CPU workload:
  Total time: 0.2063s
  Tasks completed: 5
  ✓ Performance meets expectations (< 0.35s)
.
winloop loop - Mixed I/O and CPU workload:
  Total time: 0.2075s
  Tasks completed: 5
  ✓ Performance meets expectations (< 0.35s)
.
======================================================================
Asyncio Performance Report
======================================================================

Test Configuration:
  Sample rate: 44100 Hz
  Duration: 5.0 seconds (220500 samples)
  Conversion ratio: 2.0x
  Executor: ThreadPoolExecutor

----------------------------------------------------------------------
Converter: sinc_fastest
----------------------------------------------------------------------
  1 concurrent task (baseline):
    Execution time: 0.0252s
  2 concurrent tasks:
    Parallel execution time: 0.0507s
    Equivalent sequential time: 0.0504s (2 × 0.0252s)
    Speedup: 0.99x
    Parallel efficiency: 49.6%
  4 concurrent tasks:
    Parallel execution time: 0.1002s
    Equivalent sequential time: 0.1007s (4 × 0.0252s)
    Speedup: 1.00x
    Parallel efficiency: 25.1%

----------------------------------------------------------------------
Converter: sinc_medium
----------------------------------------------------------------------
  1 concurrent task (baseline):
    Execution time: 0.0497s
  2 concurrent tasks:
    Parallel execution time: 0.0986s
    Equivalent sequential time: 0.0995s (2 × 0.0497s)
    Speedup: 1.01x
    Parallel efficiency: 50.4%
  4 concurrent tasks:
    Parallel execution time: 0.1967s
    Equivalent sequential time: 0.1990s (4 × 0.0497s)
    Speedup: 1.01x
    Parallel efficiency: 25.3%

----------------------------------------------------------------------
Converter: sinc_best
----------------------------------------------------------------------
  1 concurrent task (baseline):
    Execution time: 0.1532s
  2 concurrent tasks:
    Parallel execution time: 0.3157s
    Equivalent sequential time: 0.3064s (2 × 0.1532s)
    Speedup: 0.97x
    Parallel efficiency: 48.5%
  4 concurrent tasks:
    Parallel execution time: 0.6162s
    Equivalent sequential time: 0.6127s (4 × 0.1532s)
    Speedup: 0.99x
    Parallel efficiency: 24.9%
.
======================================================================
Asyncio Performance Report
======================================================================

Test Configuration:
  Sample rate: 44100 Hz
  Duration: 5.0 seconds (220500 samples)
  Conversion ratio: 2.0x
  Executor: ThreadPoolExecutor

----------------------------------------------------------------------
Converter: sinc_fastest
----------------------------------------------------------------------
  1 concurrent task (baseline):
    Execution time: 0.0251s
  2 concurrent tasks:
    Parallel execution time: 0.0505s
    Equivalent sequential time: 0.0502s (2 × 0.0251s)
    Speedup: 1.00x
    Parallel efficiency: 49.8%
  4 concurrent tasks:
    Parallel execution time: 0.1011s
    Equivalent sequential time: 0.1005s (4 × 0.0251s)
    Speedup: 0.99x
    Parallel efficiency: 24.8%

----------------------------------------------------------------------
Converter: sinc_medium
----------------------------------------------------------------------
  1 concurrent task (baseline):
    Execution time: 0.0496s
  2 concurrent tasks:
    Parallel execution time: 0.0986s
    Equivalent sequential time: 0.0993s (2 × 0.0496s)
    Speedup: 1.01x
    Parallel efficiency: 50.4%
  4 concurrent tasks:
    Parallel execution time: 0.1966s
    Equivalent sequential time: 0.1986s (4 × 0.0496s)
    Speedup: 1.01x
    Parallel efficiency: 25.3%

----------------------------------------------------------------------
Converter: sinc_best
----------------------------------------------------------------------
  1 concurrent task (baseline):
    Execution time: 0.1528s
  2 concurrent tasks:
    Parallel execution time: 0.3054s
    Equivalent sequential time: 0.3057s (2 × 0.1528s)
    Speedup: 1.00x
    Parallel efficiency: 50.0%
  4 concurrent tasks:
    Parallel execution time: 0.6147s
    Equivalent sequential time: 0.6113s (4 × 0.1528s)
    Speedup: 0.99x
    Parallel efficiency: 24.9%

threading

PS C:\Users\shaun\python-samplerate-ledfx> uv run pytest .\tests\test_threading_performance.py -s       
Uninstalled 1 package in 8ms
Installed 1 package in 10ms
================================================================ test session starts =================================================================
platform win32 -- Python 3.11.9, pytest-9.0.1, pluggy-1.6.0
rootdir: C:\Users\shaun\python-samplerate-ledfx
configfile: pyproject.toml
plugins: asyncio-1.3.0
asyncio: mode=Mode.STRICT, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collected 38 items                                                                                                                                    

tests\test_threading_performance.py
sinc_fastest with 2 threads:
  Sequential: 0.0499s
  Parallel: 0.0505s
  Speedup: 0.99x
  Platform: AMD64
  Individual thread times: ['0.0250s', '0.0248s']
  ⚠️  WARNING: Speedup 0.99x is below expected 1.2x
      Expected: 1.2x, Got: 0.99x
      (sequential=0.0499s, parallel=0.0505s)
      This may be due to CI load or platform-specific threading overhead.
.
sinc_fastest with 4 threads:
  Sequential: 0.1058s
  Parallel: 0.1010s
  Speedup: 1.05x
  Platform: AMD64
  Individual thread times: ['0.0251s', '0.0251s', '0.0250s', '0.0250s']
  ⚠️  WARNING: Speedup 1.05x is below expected 1.35x
      Expected: 1.35x, Got: 1.05x
      (sequential=0.1058s, parallel=0.1010s)
      This may be due to CI load or platform-specific threading overhead.
.
sinc_fastest with 6 threads:
  Sequential: 0.1491s
  Parallel: 0.1509s
  Speedup: 0.99x
  Platform: AMD64
  Individual thread times: ['0.0250s', '0.0249s', '0.0251s', '0.0250s', '0.0249s', '0.0249s']
  ⚠️  WARNING: Speedup 0.99x is below expected 1.35x
      Expected: 1.35x, Got: 0.99x
      (sequential=0.1491s, parallel=0.1509s)
      This may be due to CI load or platform-specific threading overhead.
.
sinc_fastest with 8 threads:
  Sequential: 0.1994s
  Parallel: 0.2010s
  Speedup: 0.99x
  Platform: AMD64
  Individual thread times: ['0.0249s', '0.0254s', '0.0249s', '0.0249s', '0.0250s', '0.0249s', '0.0248s', '0.0248s']
  ⚠️  WARNING: Speedup 0.99x is below expected 1.35x
      Expected: 1.35x, Got: 0.99x
      (sequential=0.1994s, parallel=0.2010s)
      This may be due to CI load or platform-specific threading overhead.
.
sinc_medium with 2 threads:
  Sequential: 0.0980s
  Parallel: 0.0982s
  Speedup: 1.00x
  Platform: AMD64
  Individual thread times: ['0.0489s', '0.0489s']
  ⚠️  WARNING: Speedup 1.00x is below expected 1.2x
      Expected: 1.2x, Got: 1.00x
      (sequential=0.0980s, parallel=0.0982s)
      This may be due to CI load or platform-specific threading overhead.
.
sinc_medium with 4 threads:
  Sequential: 0.1961s
  Parallel: 0.1983s
  Speedup: 0.99x
  Platform: AMD64
  Individual thread times: ['0.0489s', '0.0490s', '0.0501s', '0.0496s']
  ⚠️  WARNING: Speedup 0.99x is below expected 1.35x
      Expected: 1.35x, Got: 0.99x
      (sequential=0.1961s, parallel=0.1983s)
      This may be due to CI load or platform-specific threading overhead.
.
sinc_medium with 6 threads:
  Sequential: 0.2936s
  Parallel: 0.2966s
  Speedup: 0.99x
  Platform: AMD64
  Individual thread times: ['0.0489s', '0.0491s', '0.0490s', '0.0506s', '0.0490s', '0.0489s']
  ⚠️  WARNING: Speedup 0.99x is below expected 1.35x
      Expected: 1.35x, Got: 0.99x
      (sequential=0.2936s, parallel=0.2966s)
      This may be due to CI load or platform-specific threading overhead.
.
sinc_medium with 8 threads:
  Sequential: 0.3924s
  Parallel: 0.3926s
  Speedup: 1.00x
  Platform: AMD64
  Individual thread times: ['0.0492s', '0.0492s', '0.0489s', '0.0489s', '0.0488s', '0.0488s', '0.0488s', '0.0488s']
  ⚠️  WARNING: Speedup 1.00x is below expected 1.35x
      Expected: 1.35x, Got: 1.00x
      (sequential=0.3924s, parallel=0.3926s)
      This may be due to CI load or platform-specific threading overhead.
.
sinc_best with 2 threads:
  Sequential: 0.3042s
  Parallel: 0.3048s
  Speedup: 1.00x
  Platform: AMD64
  Individual thread times: ['0.1523s', '0.1521s']
  ⚠️  WARNING: Speedup 1.00x is below expected 1.2x
      Expected: 1.2x, Got: 1.00x
      (sequential=0.3042s, parallel=0.3048s)
      This may be due to CI load or platform-specific threading overhead.
.
sinc_best with 4 threads:
  Sequential: 0.6091s
  Parallel: 0.6084s
  Speedup: 1.00x
  Platform: AMD64
  Individual thread times: ['0.1518s', '0.1517s', '0.1521s', '0.1521s']
  ⚠️  WARNING: Speedup 1.00x is below expected 1.35x
      Expected: 1.35x, Got: 1.00x
      (sequential=0.6091s, parallel=0.6084s)
      This may be due to CI load or platform-specific threading overhead.
.
sinc_best with 6 threads:
  Sequential: 0.9147s
  Parallel: 0.9118s
  Speedup: 1.00x
  Platform: AMD64
  Individual thread times: ['0.1521s', '0.1519s', '0.1520s', '0.1517s', '0.1516s', '0.1515s']
  ⚠️  WARNING: Speedup 1.00x is below expected 1.35x
      Expected: 1.35x, Got: 1.00x
      (sequential=0.9147s, parallel=0.9118s)
      This may be due to CI load or platform-specific threading overhead.
.
sinc_best with 8 threads:
  Sequential: 1.2161s
  Parallel: 1.2192s
  Speedup: 1.00x
  Platform: AMD64
  Individual thread times: ['0.1520s', '0.1536s', '0.1518s', '0.1518s', '0.1517s', '0.1527s', '0.1522s', '0.1522s']
  ⚠️  WARNING: Speedup 1.00x is below expected 1.35x
      Expected: 1.35x, Got: 1.00x
      (sequential=1.2161s, parallel=1.2192s)
      This may be due to CI load or platform-specific threading overhead.
.
sinc_fastest Resampler.process() with 2 threads:
  Sequential: 0.0501s
  Parallel: 0.0519s
  Speedup: 0.97x
  Platform: AMD64
  Individual thread times: ['0.0265s', '0.0248s']
  ⚠️  WARNING: Speedup 0.97x is below expected 1.1x
      This may be due to CI load or platform-specific threading overhead.
.
sinc_fastest Resampler.process() with 4 threads:
  Sequential: 0.1036s
  Parallel: 0.1010s
  Speedup: 1.03x
  Platform: AMD64
  Individual thread times: ['0.0249s', '0.0251s', '0.0250s', '0.0249s']
  ⚠️  WARNING: Speedup 1.03x is below expected 1.25x
      This may be due to CI load or platform-specific threading overhead.
.
sinc_fastest Resampler.process() with 6 threads:
  Sequential: 0.1497s
  Parallel: 0.1516s
  Speedup: 0.99x
  Platform: AMD64
  Individual thread times: ['0.0250s', '0.0255s', '0.0250s', '0.0250s', '0.0249s', '0.0250s']
  ⚠️  WARNING: Speedup 0.99x is below expected 1.25x
      This may be due to CI load or platform-specific threading overhead.
.
sinc_fastest Resampler.process() with 8 threads:
  Sequential: 0.2064s
  Parallel: 0.2013s
  Speedup: 1.03x
  Platform: AMD64
  Individual thread times: ['0.0250s', '0.0251s', '0.0250s', '0.0249s', '0.0250s', '0.0250s', '0.0250s', '0.0249s']
  ⚠️  WARNING: Speedup 1.03x is below expected 1.25x
      This may be due to CI load or platform-specific threading overhead.
.
sinc_medium Resampler.process() with 2 threads:
  Sequential: 0.0980s
  Parallel: 0.0984s
  Speedup: 1.00x
  Platform: AMD64
  Individual thread times: ['0.0490s', '0.0488s']
  ⚠️  WARNING: Speedup 1.00x is below expected 1.1x
      This may be due to CI load or platform-specific threading overhead.
.
sinc_medium Resampler.process() with 4 threads:
  Sequential: 0.1958s
  Parallel: 0.1961s
  Speedup: 1.00x
  Platform: AMD64
  Individual thread times: ['0.0488s', '0.0489s', '0.0489s', '0.0488s']
  ⚠️  WARNING: Speedup 1.00x is below expected 1.25x
      This may be due to CI load or platform-specific threading overhead.
.
sinc_medium Resampler.process() with 6 threads:
  Sequential: 0.2936s
  Parallel: 0.2942s
  Speedup: 1.00x
  Platform: AMD64
  Individual thread times: ['0.0489s', '0.0489s', '0.0488s', '0.0490s', '0.0488s', '0.0488s']
  ⚠️  WARNING: Speedup 1.00x is below expected 1.25x
      This may be due to CI load or platform-specific threading overhead.
.
sinc_medium Resampler.process() with 8 threads:
  Sequential: 0.3911s
  Parallel: 0.3932s
  Speedup: 0.99x
  Platform: AMD64
  Individual thread times: ['0.0491s', '0.0490s', '0.0490s', '0.0490s', '0.0490s', '0.0489s', '0.0490s', '0.0489s']
  ⚠️  WARNING: Speedup 0.99x is below expected 1.25x
      This may be due to CI load or platform-specific threading overhead.
.
sinc_best Resampler.process() with 2 threads:
  Sequential: 0.3034s
  Parallel: 0.3042s
  Speedup: 1.00x
  Platform: AMD64
  Individual thread times: ['0.1517s', '0.1519s']
  ⚠️  WARNING: Speedup 1.00x is below expected 1.1x
      This may be due to CI load or platform-specific threading overhead.
.
sinc_best Resampler.process() with 4 threads:
  Sequential: 0.6090s
  Parallel: 0.6097s
  Speedup: 1.00x
  Platform: AMD64
  Individual thread times: ['0.1518s', '0.1523s', '0.1527s', '0.1520s']
  ⚠️  WARNING: Speedup 1.00x is below expected 1.25x
      This may be due to CI load or platform-specific threading overhead.
.
sinc_best Resampler.process() with 6 threads:
  Sequential: 0.9141s
  Parallel: 0.9120s
  Speedup: 1.00x
  Platform: AMD64
  Individual thread times: ['0.1523s', '0.1519s', '0.1515s', '0.1519s', '0.1518s', '0.1516s']
  ⚠️  WARNING: Speedup 1.00x is below expected 1.25x
      This may be due to CI load or platform-specific threading overhead.
.
sinc_best Resampler.process() with 8 threads:
  Sequential: 1.2158s
  Parallel: 1.2170s
  Speedup: 1.00x
  Platform: AMD64
  Individual thread times: ['0.1516s', '0.1521s', '0.1516s', '0.1516s', '0.1517s', '0.1521s', '0.1524s', '0.1524s']
  ⚠️  WARNING: Speedup 1.00x is below expected 1.25x
      This may be due to CI load or platform-specific threading overhead.
.
sinc_fastest CallbackResampler with 2 threads:
  Sequential: 0.0503s
  Parallel: 0.0517s
  Speedup: 0.97x
  Platform: AMD64
  Individual thread times: ['0.0509s', '0.0255s']
  ⚠️  WARNING: Speedup 0.97x is below expected 1.2x
      This may be due to CI load or platform-specific threading overhead.
.
sinc_fastest CallbackResampler with 4 threads:
  Sequential: 0.1006s
  Parallel: 0.1013s
  Speedup: 0.99x
  Platform: AMD64
  Individual thread times: ['0.0499s', '0.0500s', '0.0504s', '0.0256s']
  ⚠️  WARNING: Speedup 0.99x is below expected 1.2x
      This may be due to CI load or platform-specific threading overhead.
.
sinc_fastest CallbackResampler with 6 threads:
  Sequential: 0.1515s
  Parallel: 0.1519s
  Speedup: 1.00x
  Platform: AMD64
  Individual thread times: ['0.0501s', '0.0504s', '0.0502s', '0.0503s', '0.0501s', '0.0255s']
  ⚠️  WARNING: Speedup 1.00x is below expected 1.2x
      This may be due to CI load or platform-specific threading overhead.
.
sinc_fastest CallbackResampler with 8 threads:
  Sequential: 0.2028s
  Parallel: 0.2021s
  Speedup: 1.00x
  Platform: AMD64
  Individual thread times: ['0.0501s', '0.0503s', '0.0503s', '0.0501s', '0.0501s', '0.0502s', '0.0501s', '0.0254s']
  ⚠️  WARNING: Speedup 1.00x is below expected 1.2x
      This may be due to CI load or platform-specific threading overhead.
.
sinc_medium CallbackResampler with 2 threads:
  Sequential: 0.0985s
  Parallel: 0.0989s
  Speedup: 1.00x
  Platform: AMD64
  Individual thread times: ['0.0981s', '0.0496s']
  ⚠️  WARNING: Speedup 1.00x is below expected 1.2x
      This may be due to CI load or platform-specific threading overhead.
.
sinc_medium CallbackResampler with 4 threads:
  Sequential: 0.1971s
  Parallel: 0.1971s
  Speedup: 1.00x
  Platform: AMD64
  Individual thread times: ['0.0979s', '0.0981s', '0.0981s', '0.0495s']
  ⚠️  WARNING: Speedup 1.00x is below expected 1.2x
      This may be due to CI load or platform-specific threading overhead.
.
sinc_medium CallbackResampler with 6 threads:
  Sequential: 0.2951s
  Parallel: 0.2960s
  Speedup: 1.00x
  Platform: AMD64
  Individual thread times: ['0.0980s', '0.0984s', '0.0983s', '0.0983s', '0.0983s', '0.0495s']
  ⚠️  WARNING: Speedup 1.00x is below expected 1.2x
      This may be due to CI load or platform-specific threading overhead.
.
sinc_medium CallbackResampler with 8 threads:
  Sequential: 0.3936s
  Parallel: 0.3941s
  Speedup: 1.00x
  Platform: AMD64
  Individual thread times: ['0.0983s', '0.0981s', '0.0981s', '0.0982s', '0.0981s', '0.0981s', '0.0981s', '0.0494s']
  ⚠️  WARNING: Speedup 1.00x is below expected 1.2x
      This may be due to CI load or platform-specific threading overhead.
.
sinc_best CallbackResampler with 2 threads:
  Sequential: 0.3052s
  Parallel: 0.3046s
  Speedup: 1.00x
  Platform: AMD64
  Individual thread times: ['0.3036s', '0.1523s']
  ⚠️  WARNING: Speedup 1.00x is below expected 1.2x
      This may be due to CI load or platform-specific threading overhead.
.
sinc_best CallbackResampler with 4 threads:
  Sequential: 0.6113s
  Parallel: 0.6576s
  Speedup: 0.93x
  Platform: AMD64
  Individual thread times: ['0.3029s', '0.3105s', '0.3532s', '0.1948s']
  ⚠️  WARNING: Speedup 0.93x is below expected 1.2x
      This may be due to CI load or platform-specific threading overhead.
.
sinc_best CallbackResampler with 6 threads:
  Sequential: 1.0773s
  Parallel: 1.0299s
  Speedup: 1.05x
  Platform: AMD64
  Individual thread times: ['0.3172s', '0.3112s', '0.3624s', '0.4016s', '0.3482s', '0.1543s']
  ⚠️  WARNING: Speedup 1.05x is below expected 1.2x
      This may be due to CI load or platform-specific threading overhead.
.
sinc_best CallbackResampler with 8 threads:
  Sequential: 1.4173s
  Parallel: 1.2259s
  Speedup: 1.16x
  Platform: AMD64
  Individual thread times: ['0.3069s', '0.3045s', '0.3059s', '0.3069s', '0.3054s', '0.3051s', '0.3054s', '0.1532s']
  ⚠️  WARNING: Speedup 1.16x is below expected 1.2x
      This may be due to CI load or platform-specific threading overhead.
..
======================================================================
GIL Release Performance Report
======================================================================

Test Configuration:
  Sample rate: 44100 Hz
  Duration: 5.0 seconds (220500 samples)
  Conversion ratio: 2.0x

----------------------------------------------------------------------
Converter: sinc_fastest
----------------------------------------------------------------------
  1 thread (baseline):
    Execution time: 0.0250s
  2 threads (parallel):
    Parallel execution time: 0.0503s
    Equivalent sequential time: 0.0499s (2 × 0.0250s)
    Speedup: 0.99x
    Parallel efficiency: 49.7%
    Avg thread time: 0.0249s
  4 threads (parallel):
    Parallel execution time: 0.1006s
    Equivalent sequential time: 0.0998s (4 × 0.0250s)
    Speedup: 0.99x
    Parallel efficiency: 24.8%
    Avg thread time: 0.0250s

----------------------------------------------------------------------
Converter: sinc_medium
----------------------------------------------------------------------
  1 thread (baseline):
    Execution time: 0.0492s
  2 threads (parallel):
    Parallel execution time: 0.0985s
    Equivalent sequential time: 0.0984s (2 × 0.0492s)
    Speedup: 1.00x
    Parallel efficiency: 49.9%
    Avg thread time: 0.0491s
  4 threads (parallel):
    Parallel execution time: 0.1976s
    Equivalent sequential time: 0.1968s (4 × 0.0492s)
    Speedup: 1.00x
    Parallel efficiency: 24.9%
    Avg thread time: 0.0493s

----------------------------------------------------------------------
Converter: sinc_best
----------------------------------------------------------------------
  1 thread (baseline):
    Execution time: 0.1518s
  2 threads (parallel):
    Parallel execution time: 0.3054s
    Equivalent sequential time: 0.3036s (2 × 0.1518s)
    Speedup: 0.99x
    Parallel efficiency: 49.7%
    Avg thread time: 0.1525s
  4 threads (parallel):
    Parallel execution time: 0.6081s
    Equivalent sequential time: 0.6073s (4 × 0.1518s)
    Speedup: 1.00x
    Parallel efficiency: 25.0%
    Avg thread time: 0.1519s

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.

2 participants