Skip to content

Commit 877b65a

Browse files
authored
[perf] NoOpTest.run_async() should yield to avoid blocking event loop (Azure#23741)
- Fixes Azure#23740 - Reduces throughput by almost a factor of 10 (1.3M vs 160k ops/sec), but allows for parallel execution and should more accurately represent real-world async performance.
1 parent 3db89d7 commit 877b65a

File tree

1 file changed

+5
-1
lines changed
  • tools/azure-devtools/src/azure_devtools/perfstress_tests/system_perfstress

1 file changed

+5
-1
lines changed

tools/azure-devtools/src/azure_devtools/perfstress_tests/system_perfstress/no_op_test.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Licensed under the MIT License. See License.txt in the project root for license information.
44
# --------------------------------------------------------------------------------------------
55

6+
import asyncio
67
from azure_devtools.perfstress_tests import PerfStressTest
78

89

@@ -11,4 +12,7 @@ def run_sync(self):
1112
pass
1213

1314
async def run_async(self):
14-
pass
15+
# Yield on each call to avoid blocking the event loop. Also simulates a real call to async IO.
16+
# Reduces throughput by almost a factor of 10 (1.3M vs 160k ops/sec), but allows for parallel execution
17+
# and should more accurately represent real-world async performance.
18+
await asyncio.sleep(0)

0 commit comments

Comments
 (0)