1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* benchmark/bm_require.rb: new benchmark for require.

* benchmark/bm_require_thread.rb: new benchmark for conflicting
  require vs thread. like [Bug #11559]
* prepare_require.rb: new file for preparing above tests.
* prepare_require.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kosaki 2015-10-08 21:31:49 +00:00
parent 4b395bb4ce
commit 8c84716b24
5 changed files with 45 additions and 0 deletions

View file

@ -1,3 +1,10 @@
Fri Oct 9 06:18:04 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* benchmark/bm_require.rb: new benchmark for require.
* benchmark/bm_require_thread.rb: new benchmark for conflicting
require vs thread. like [Bug #11559]
* prepare_require.rb: new file for preparing above tests.
* prepare_require.rb: ditto.
Thu Oct 8 14:10:45 2015 Zachary Scott <zzak@ruby-lang.org>
* ext/openssl/lib/openssl/ssl.rb: Default to TLSv1.2 and drop TLS v1

7
benchmark/bm_require.rb Normal file
View file

@ -0,0 +1,7 @@
$:.push File.join(File.dirname(__FILE__), "bm_require.data")
1.upto(10000) do |i|
require "c#{i}"
end
$:.pop

View file

@ -0,0 +1,15 @@
$:.push File.join(File.dirname(__FILE__), "bm_require.data")
i=0
t = Thread.new do
while true
i = i+1 # dummy loop
end
end
1.upto(100) do |i|
require "c#{i}"
end
$:.pop
t.kill

View file

@ -0,0 +1,14 @@
require "fileutils"
basename = File.dirname($0)
data_dir = File.join(basename, "bm_require.data")
FileUtils.mkdir_p(data_dir)
1.upto(10000) do |i|
f = File.open("#{data_dir}/c#{i}.rb", "w")
f.puts <<-END
class C#{i}
end
END
end

View file

@ -0,0 +1,2 @@
load File.join(File.dirname(__FILE__), "prepare_require.rb")