-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
26 lines (23 loc) · 799 Bytes
/
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
require 'rake'
require 'rake/testtask'
Rake::TestTask.new do |t|
t.test_files = FileList['test/test*.rb']
t.verbose = true
end
desc "benchmark"
task :benchmark do |b|
require 'base64'
require 'benchmark'
require 'lib/base64_compatible'
require 'test/strings'
include Strings
n = 5000
encoded_login_string = Base64Compatible.encode64(LOGIN_STRING)
puts ""
Benchmark.bm do |x|
x.report("Base64.encode64") { n.times do; Base64.encode64(LOGIN_STRING); end }
x.report("Base64Compatible.encode64") { n.times do ; Base64Compatible.encode64(LOGIN_STRING); end }
x.report("Base64.decode64") { n.times do; Base64.decode64(encoded_login_string); end }
x.report("Base64Compatible.decode64") { n.times do ; Base64Compatible.decode64(encoded_login_string); end }
end
end