Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A look at how ObjectSpace finalizers affect GC time
$ ruby test.rb false
0.210000 0.000000 0.210000 ( 0.212155)
$ ruby test.rb true
10.000000 0.280000 10.280000 ( 10.773232)
require 'benchmark'
n = 10_000_000
finalizer = proc { } if ARGV[0] == 'true'
GC.disable
n.times {
o = Object.new
ObjectSpace.define_finalizer(o, finalizer) if finalizer
}
puts Benchmark.measure {
GC.enable
GC.start
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.