We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a0c12c0 commit b2fa976Copy full SHA for b2fa976
benchmarks.yml
@@ -119,6 +119,10 @@ respond_to:
119
desc: respond_to tests the performance of the respond_to? method.
120
category: micro
121
single_file: true
122
+object-new:
123
+ desc: instantiate a new object in a loop to test allocation performance
124
+ category: micro
125
+ single_file: true
126
setivar:
127
desc: setivar tests the performance of setting instance variable values.
128
benchmarks/object-new.rb
@@ -0,0 +1,9 @@
1
+require_relative '../harness/loader'
2
+
3
+run_benchmark(100) do
4
+ i = 0
5
+ while i < 1_000_000
6
+ Object.new
7
+ i += 1
8
+ end
9
+end
0 commit comments