feat: dynamically grow fiber call frame array instead of fixed MAX_CALL_FRAMES

Replace the statically-sized CallFrame array in ObjFiber with a dynamically
allocated array that starts at INITIAL_CALL_FRAMES (4) and doubles when
capacity is exceeded. This reduces memory for new fibers and improves
fiber creation benchmark performance by ~45%.
This commit is contained in:
Bob Nystrom
2015-07-01 07:00:25 +00:00
parent 8ae42156d8
commit 29ca6f4ffc
5 changed files with 82 additions and 36 deletions
+2
View File
@@ -67,6 +67,8 @@ BENCHMARK("fib", r"""317811
317811
317811""")
BENCHMARK("fibers", r"""4999950000""")
BENCHMARK("for", r"""499999500000""")
BENCHMARK("method_call", r"""true