Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Benchmark for ruby require performance with LOAD_PATH
$LOAD_PATH.unshift(File.expand_path('f'))
x = 0
y = 0
require 'benchmark'
Benchmark.bm do |b|
step = 500
(0..4).each do |n|
b.report("#{n * step} in load path") { 50.times { require "bogus#{x}"; x += 1 }}
step.times do
$LOAD_PATH.unshift("/tmp/folder#{y}")
y += 1
end
$LOADED_FEATURES.clear
$stdout.flush
end
end
`mkdir f`
10000.times do |x|
`touch f/bogus#{x}.rb`
end
@xaviershay
Owner

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.