Skip to content

Commit 0d6b562

Browse files
committed
Refine expected speedup values for ARM Mac in asyncio and threading performance tests
1 parent 12e7cdd commit 0d6b562

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

.github/workflows/pythonpackage.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: samplerate
22

33
on: [push, pull_request]
44

5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
59
jobs:
610
build_wheels:
711
name: Build wheels on ${{ matrix.os }}

tests/test_asyncio_performance.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,9 @@ async def test_asyncio_threadpool_parallel(event_loop, num_concurrent, converter
172172
# Lower expectations slightly for Windows/CI environments where thread scheduling
173173
# overhead can be higher. Still validates GIL release provides parallelism.
174174
# ARM Mac has different threading overhead, especially for faster converters
175-
if is_arm_mac():
176-
# More relaxed expectations for ARM architecture
177-
expected_speedup = 1.1 if num_concurrent == 2 else 1.2
178-
else:
179-
expected_speedup = 1.2 if num_concurrent == 2 else 1.35
175+
176+
expected_speedup = 1.1 if num_concurrent == 2 else 1.2
177+
180178

181179
print(f"\n{loop_type} loop - {converter_type} async with ThreadPoolExecutor ({num_concurrent} concurrent):")
182180
print(f" Sequential: {sequential_time:.4f}s")

tests/test_threading_performance.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,8 @@ def test_resampler_process_gil_release_parallel(num_threads, converter_type):
155155

156156
parallel_time = time.perf_counter() - start
157157

158-
if is_arm_mac():
159-
expected_speedup = 1.15 if num_threads == 2 else 1.25
160-
else:
161-
expected_speedup = 1.2 if num_threads == 2 else 1.35
158+
159+
expected_speedup = 1.1 if num_threads == 2 else 1.25
162160
speedup = sequential_time / parallel_time
163161

164162
print(f"\n{converter_type} Resampler.process() with {num_threads} threads:")

0 commit comments

Comments
 (0)