summaryrefslogtreecommitdiff
path: root/benchmark/loop_generator.yml
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/loop_generator.yml')
-rw-r--r--benchmark/loop_generator.yml17
1 files changed, 17 insertions, 0 deletions
diff --git a/benchmark/loop_generator.yml b/benchmark/loop_generator.yml
new file mode 100644
index 0000000..a5a39c0
--- /dev/null
+++ b/benchmark/loop_generator.yml
@@ -0,0 +1,17 @@
+benchmark:
+ loop_generator: |
+ max = 600000
+
+ if defined? Fiber
+ gen = (1..max).each
+ loop do
+ gen.next
+ end
+ else
+ require 'generator'
+ gen = Generator.new((0..max))
+ while gen.next?
+ gen.next
+ end
+ end
+loop_count: 1