Skip to content

Commit fd7a209

Browse files
committed
Fewer loops
1 parent bc45007 commit fd7a209

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Lib/test/test_profiling/test_sampling_profiler.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3124,9 +3124,9 @@ def setUpClass(cls):
31243124
31253125
def python_to_c():
31263126
# Native code at the top of the stack:
3127-
sum(range(1_000_000))
3127+
sum(range(200))
31283128
# Python code at the top of the stack:
3129-
for _ in range(1_000_000):
3129+
for _ in range(100):
31303130
pass
31313131
31323132
def main_loop():
@@ -3159,7 +3159,7 @@ def test_native_frames_enabled(self):
31593159
duration_sec=1,
31603160
filename=collapsed_file.name,
31613161
output_format="collapsed",
3162-
sample_interval_usec=5000,
3162+
sample_interval_usec=1000,
31633163
native=True,
31643164
)
31653165
except PermissionError:
@@ -3172,6 +3172,8 @@ def test_native_frames_enabled(self):
31723172
# Check file format
31733173
with open(collapsed_file.name, "r") as f:
31743174
content = f.read()
3175+
print()
3176+
print(content) # For debugging purposes
31753177

31763178
lines = content.strip().split("\n")
31773179
self.assertGreater(len(lines), 0)

0 commit comments

Comments
 (0)