-
Notifications
You must be signed in to change notification settings - Fork 5
/
Rakefile
70 lines (61 loc) · 1.65 KB
/
Rakefile
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# frozen_string_literal: true
require "bundler/gem_tasks"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
require "standard/rake"
task default: %i[spec standard]
namespace :benchmark do
task all: ["success:simple", "success:cpu_bound", "success:io_bound", "failure:simple"]
namespace :success do
task :simple do
puts "### Benchmark success:simple"
puts
puts "This runs a script that does not do any IO or CPU bound work."
puts
ENV["RUBYOPT"] = "-W:no-experimental"
ENV["RUBY_MN_THREADS"] = "1"
puts "```"
sh "ruby", "benchmark/success_simple.rb"
puts "```"
puts
end
task :cpu_bound do
puts "### Benchmark success:cpu_bound"
puts
puts "This runs a script that does CPU bound work."
puts
ENV["RUBYOPT"] = "-W:no-experimental"
ENV["RUBY_MN_THREADS"] = "1"
puts "```"
sh "ruby", "benchmark/success_cpu_bound.rb"
puts "```"
puts
end
task :io_bound do
puts "### Benchmark success:io_bound"
puts
puts "This runs a script that does IO bound work."
puts
ENV["RUBYOPT"] = "-W:no-experimental"
ENV["RUBY_MN_THREADS"] = "1"
puts "```"
sh "ruby", "benchmark/success_io_bound.rb"
puts "```"
puts
end
end
namespace :failure do
task :simple do
puts "### Benchmark failure:simple"
puts
puts "This runs a script that fails and shrink happens."
puts
ENV["RUBYOPT"] = "-W:no-experimental"
ENV["RUBY_MN_THREADS"] = "1"
puts "```"
sh "ruby", "benchmark/failure_simple.rb"
puts "```"
puts
end
end
end