File tree Expand file tree Collapse file tree 4 files changed +51
-0
lines changed
Expand file tree Collapse file tree 4 files changed +51
-0
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,18 @@ cfunc_itself:
112112 desc : cfunc_itself just calls the 'itself' method many, many times.
113113 category : micro
114114 single_file : true
115+ send_cfunc_block :
116+ desc : send_cfunc_block just calls a known C function with a block many, many times.
117+ category : micro
118+ single_file : true
119+ send_rubyfunc_block :
120+ desc : send_rubyfunc_block just calls a known Ruby function with a block many, many times.
121+ category : micro
122+ single_file : true
123+ send_bmethod :
124+ desc : send_bmethod just calls known Ruby bmethods many, many times.
125+ category : micro
126+ single_file : true
115127fib :
116128 desc : Fib is a simple exponential-time recursive Fibonacci number generator.
117129 category : micro
Original file line number Diff line number Diff line change 1+ require_relative '../harness/loader'
2+
3+ # Call with and without args
4+ define_method ( :zero ) { :b }
5+ define_method ( :one ) { |arg | arg }
6+
7+ run_benchmark ( 500 ) do
8+ 2_000_000 . times do |i |
9+ zero
10+ one 123
11+ end
12+ end
Original file line number Diff line number Diff line change 1+ require_relative '../harness/loader'
2+
3+ ARR = [ ]
4+
5+ run_benchmark ( 500 ) do
6+ 2_000_000 . times do |i |
7+ # each is a 0-arg cfunc
8+ ARR . each { }
9+ # index is a variadic cfunc
10+ ARR . index { }
11+ end
12+ end
Original file line number Diff line number Diff line change 1+ require_relative '../harness/loader'
2+
3+ class C
4+ def ruby_func
5+ # Don't even yield
6+ end
7+ end
8+
9+ INSTANCE = C . new
10+
11+ run_benchmark ( 500 ) do
12+ 2_000_000 . times do |i |
13+ INSTANCE . ruby_func { }
14+ end
15+ end
You can’t perform that action at this time.
0 commit comments