mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
3293322a39
Makefile.in: Clone benchmark-driver repository in benchmark/benchmark-driver `make update-benchmark-driver`, like simplecov. win32/Makefile.sub: Roughly do the same thing. .gitignore: Ignore the cloned repository. common.mk: Trigger `make update-benchmark-driver` to run `make benchmark` and adjust arguments for benchmark_driver.gem. benchmark/require.yml: renamed from benchmark/bm_require.rb, benchmark/prepare_require.rb benchmark/require_thread.yml: renamed from benchmark/bm_require_thread.rb, benchmark/prepare_require_thread.rb benchmark/so_count_words.yml: renamed from benchmark/bm_so_count_words.rb, benchmark/prepare_so_count_words.rb, benchmark/wc.input.base benchmark/so_k_nucleotide.yml: renamed from benchmark/bm_so_k_nucleotide.rb, benchmark/prepare_so_k_nucleotide.rb, benchmark/make_fasta_output.rb benchmark/so_reverse_complement.yml: renamed from benchmark/bm_so_reverse_complement.rb, benchmark/prepare_so_reverse_complement.rb, benchmark/make_fasta_output.rb I'm sorry but I made some duplications between benchmark/require.yml and benchmark/require_thread.yml, and between benchmark/so_k_nucleotide.yml and benchmark/so_reverse_complement.yml. If you're not comfortable with it, please combine these YAMLs to share the same prelude. One YAML file can have multiple benchmark definitions sharing prelude. benchmark/driver.rb: Replace its core feature with benchmark_driver.gem. Some old features are gone for now, but I'll add them again later. [Misc #14902] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
36 lines
643 B
YAML
36 lines
643 B
YAML
prelude: |
|
|
require "fileutils"
|
|
|
|
def prepare
|
|
num_files = 10000
|
|
|
|
basename = File.dirname($0)
|
|
data_dir = File.join(basename, "bm_require.data")
|
|
|
|
# skip if all of files exists
|
|
if File.exist?(File.join(data_dir, "c#{num_files}.rb"))
|
|
return
|
|
end
|
|
|
|
FileUtils.mkdir_p(data_dir)
|
|
|
|
1.upto(num_files) do |i|
|
|
f = File.open("#{data_dir}/c#{i}.rb", "w")
|
|
f.puts <<-END
|
|
class C#{i}
|
|
end
|
|
END
|
|
end
|
|
end
|
|
|
|
prepare
|
|
benchmark:
|
|
require: |
|
|
$:.push File.join(File.dirname(__FILE__), "bm_require.data")
|
|
|
|
1.upto(10000) do |i|
|
|
require "c#{i}"
|
|
end
|
|
|
|
$:.pop
|
|
loop_count: 1
|