mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
move connection benchmarks to excon
This commit is contained in:
parent
93954f73ff
commit
1d5b3d19d3
2 changed files with 0 additions and 44 deletions
|
@ -1,18 +0,0 @@
|
|||
require 'benchmark'
|
||||
|
||||
COUNT = 1000
|
||||
data = "Content-Length: 100"
|
||||
Benchmark.bmbm(25) do |bench|
|
||||
bench.report('regex') do
|
||||
COUNT.times do
|
||||
header = data.match(/(.*):\s(.*)/)
|
||||
"#{header[1]}: #{header[2]}"
|
||||
end
|
||||
end
|
||||
bench.report('split') do
|
||||
COUNT.times do
|
||||
header = data.split(': ')
|
||||
"#{header[0]}: #{header[1]}"
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,26 +0,0 @@
|
|||
require 'benchmark'
|
||||
|
||||
COUNT = 1_000_000
|
||||
data = "Content-Length: 100\r\n"
|
||||
Benchmark.bmbm(25) do |bench|
|
||||
bench.report('chomp') do
|
||||
COUNT.times do
|
||||
data.chomp
|
||||
end
|
||||
end
|
||||
bench.report('chop') do
|
||||
COUNT.times do
|
||||
data.chop
|
||||
end
|
||||
end
|
||||
bench.report('strip') do
|
||||
COUNT.times do
|
||||
data.strip
|
||||
end
|
||||
end
|
||||
bench.report('index') do
|
||||
COUNT.times do
|
||||
data[0..-3]
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue