Skip to content

Commit 9509c67

Browse files
author
Hood Chatham
authored
MAINT Add current recursion limit to benchmark-stack printout (pyodide#1737)
1 parent db1945b commit 9509c67

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

benchmark/stack_usage.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
def print_info():
66
headings = [
77
"browser",
8+
"py_limit",
89
"py_usage",
910
"js_depth",
1011
"py_depth",
1112
"js_depth/py_usage",
1213
"js_depth/py_depth",
1314
]
14-
fmt = "## {{:{:d}s}} {{:{:d}.2f}} {{:{:d}g}} {{:{:d}g}} {{:{:d}g}} {{:{:d}g}}".format(
15+
fmt = "## {{:{:d}s}} {{:{:d}g}} {{:{:d}.2f}} {{:{:d}g}} {{:{:d}g}} {{:{:d}g}} {{:{:d}g}}".format(
1516
*map(len, headings)
1617
)
1718
printed_heading = False
@@ -37,6 +38,7 @@ def test_stack_usage(selenium, print_info):
3738
try { recurse(); } catch (err) { }
3839
return depth;
3940
};
41+
let py_limit = pyodide.runPython("import sys; sys.getrecursionlimit()");
4042
let py_usage = pyodide.runPython(`
4143
from js import measure_available_js_stack_depth
4244
def recurse(n):
@@ -59,6 +61,7 @@ def infiniterecurse():
5961
6062
py_depth = py_depth[0];
6163
return [
64+
py_limit,
6265
py_usage,
6366
js_depth,
6467
py_depth,

0 commit comments

Comments
 (0)