Add performance benchmarking scripts
Add scripts that were used to generate a halfway realistic set of inputs
This commit is contained in:
parent
fbebe75e2d
commit
87d4205f40
13
scripts/generate_input.rb
Normal file
13
scripts/generate_input.rb
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
require 'date'
|
||||||
|
|
||||||
|
def build(n)
|
||||||
|
shipping_options = ['S', 'M', 'L']
|
||||||
|
provider = ['MR', 'LP']
|
||||||
|
today = Date.today
|
||||||
|
n.times do |n|
|
||||||
|
today + (n / 100.to_f)
|
||||||
|
puts "#{(today + n).iso8601} #{shipping_options.sample} #{provider.sample}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
build(ARGV[0].to_i)
|
13
scripts/generate_input_month_focused.rb
Normal file
13
scripts/generate_input_month_focused.rb
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
require 'date'
|
||||||
|
|
||||||
|
def build(n)
|
||||||
|
shipping_options = ['S', 'M', 'L']
|
||||||
|
provider = ['MR', 'LP']
|
||||||
|
today = Date.today
|
||||||
|
n.times do |i|
|
||||||
|
date = today + (i / 10000.to_f)
|
||||||
|
puts "#{date.iso8601} #{shipping_options.sample} #{provider.sample}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
build(ARGV[0].to_i)
|
7
scripts/raw_performance_benchmark.rb
Normal file
7
scripts/raw_performance_benchmark.rb
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
File.open('./output.txt', 'w') do |f|
|
||||||
|
File.foreach(ARGV[0]) do |line|
|
||||||
|
f.write(line)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user