summaryrefslogtreecommitdiff
path: root/benchmark/vm3_backtrace.yml
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/vm3_backtrace.yml')
-rw-r--r--benchmark/vm3_backtrace.yml26
1 files changed, 26 insertions, 0 deletions
diff --git a/benchmark/vm3_backtrace.yml b/benchmark/vm3_backtrace.yml
new file mode 100644
index 0000000..58df4bc
--- /dev/null
+++ b/benchmark/vm3_backtrace.yml
@@ -0,0 +1,26 @@
+prelude: |
+ # get last backtrace
+benchmark:
+ vm3_backtrace: |
+
+ begin
+ caller(0, 0)
+ rescue ArgumentError
+ alias caller_orig caller
+ def caller lev, n
+ caller_orig(lev)[0..n]
+ end
+ end
+
+ def rec n
+ if n < 0
+ 100_000.times{
+ caller(0, 1)
+ }
+ else
+ rec(n-1)
+ end
+ end
+
+ rec 50
+loop_count: 1