-
Notifications
You must be signed in to change notification settings - Fork 12
/
benchmark.rb
51 lines (38 loc) · 1.71 KB
/
benchmark.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
require 'benchmark'
repeat = 1_000
puts "\nalt - aa_zz_possibiles.txt fixture"
Benchmark.bm(15) do |x|
x.report('For impl. file:') do
repeat.times { `cat spec/fixtures/aa_zz_possibles.txt | ./target/release/alt -f - lib/rubyfile_qq.rb` }
end
x.report('For test file:') do
repeat.times { `cat spec/fixtures/aa_zz_possibles.txt | ./target/release/alt -f - spec/lib/rubyfile_qr_spec.rb` }
end
end
puts "\nalt -j - aa_zz_possibles.txt fixture"
Benchmark.bm(15) do |x|
x.report('For impl. file:') do
repeat.times { `cat spec/fixtures/aa_zz_possibles.txt | ./target/release/alt -j -f - lib/rubyfile_qq.rb` }
end
x.report('For test file:') do
repeat.times { `cat spec/fixtures/aa_zz_possibles.txt | ./target/release/alt -j -f - spec/lib/rubyfile_qr_spec.rb` }
end
end
puts "\nalt - ruby_on_rails_discourse_possibles.txt fixture"
Benchmark.bm(15) do |x|
x.report('For impl. file:') do
repeat.times { `cat spec/fixtures/ruby_on_rails_discourse_possibles.txt | ./target/release/alt -f - app/controllers/admin/groups_controller.rb` }
end
x.report('For test file:') do
repeat.times { `cat spec/fixtures/ruby_on_rails_discourse_possibles.txt | ./target/release/alt -f - spec/controllers/admin/groups_controller.rb` }
end
end
puts "\nalt -j - ruby_on_rails_discourse_possibles.txt fixture"
Benchmark.bm(15) do |x|
x.report('For impl. file:') do
repeat.times { `cat spec/fixtures/ruby_on_rails_discourse_possibles.txt | ./target/release/alt -j -f - app/controllers/admin/groups_controller.rb` }
end
x.report('For test file:') do
repeat.times { `cat spec/fixtures/ruby_on_rails_discourse_possibles.txt | ./target/release/alt -j -f - spec/controllers/admin/groups_controller.rb` }
end
end