mirror of
https://github.com/ruby/ruby.git
synced 2026-08-01 02:20:48 +08:00
We don't need to call obj_free on certain types of objects anymore including
T_FLOAT, T_RATIONAL, T_COMPLEX, and T_OBJECT. It makes freeing those objects
faster.
Benchmark:
i = 0
while i < 10_000_000
Object.new
i += 1
end
Before:
Time (mean ± σ): 1.435 s ± 0.013 s [User: 1.706 s, System: 1.970 s]
Range (min … max): 1.418 s … 1.461 s 10 runs
After:
Time (mean ± σ): 1.230 s ± 0.027 s [User: 1.335 s, System: 1.743 s]
Range (min … max): 1.206 s … 1.294 s 10 runs
https://github.com/ruby/mmtk/commit/52f01ba90f