Skip to content
This repository
Browse code

Add benchmark to show that push_cached_eh is _slow_ on deeply recure …

…functions.
  • Loading branch information...
commit ad8f0a87c2dc5f127164ee4328711bbd28ad4ceb 1 parent 06de726
Vasily Chekalkin authored January 25, 2011

Showing 1 changed file with 19 additions and 0 deletions. Show diff stats Hide diff stats

  1. 19  examples/benchmarks/exceptions.pir
19  examples/benchmarks/exceptions.pir
@@ -36,6 +36,22 @@
36 36
     .return ($P0)
37 37
 .end
38 38
 
  39
+.sub 'test_push_cached_eh_deeply'
  40
+    .param int depth    :optional
  41
+    .param int has_depth :opt_flag
  42
+
  43
+    unless has_depth goto check
  44
+    depth = 10000
  45
+
  46
+  check:
  47
+    if depth !=0 goto recure
  48
+    .tailcall "test_push_cached_eh"()
  49
+
  50
+  recure:
  51
+    dec depth
  52
+    "test_push_cached_eh_deeply"(depth)
  53
+.end
  54
+
39 55
 .sub 'benchmark'
40 56
     .param pmc      sub
41 57
     .param string   desc
@@ -67,6 +83,9 @@
67 83
     .const "Sub" test_push_cached_eh = "test_push_cached_eh"
68 84
     "benchmark"(test_push_cached_eh, "push_cached_eh")
69 85
 
  86
+    .const "Sub" test_push_cached_eh_deeply = "test_push_cached_eh_deeply"
  87
+    "benchmark"(test_push_cached_eh_deeply, "push_cached_eh_deeply")
  88
+
70 89
     .const "Sub" test_push_eh = "test_push_eh"
71 90
     "benchmark"(test_push_eh, "push_eh")
72 91
 .end

0 notes on commit ad8f0a8

Please sign in to comment.
Something went wrong with that request. Please try again.