Sha256: cde21d62e070d65bf38b0440badd969d2cfc8904df007cdf3abc04684a777586

Contents?: true

Size: 424 Bytes

Versions: 19

Compression:

Stored size: 424 Bytes

Contents

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'grape'
require 'benchmark/ips'

class API < Grape::API
  prefix :api
  version 'v1', using: :path
  get '/' do
    'hello'
  end
end

options = {
  method: 'GET'
}

env = Rack::MockRequest.env_for('/api/v1', options)

10.times do |i|
  env["HTTP_HEADER#{i}"] = '123'
end

Benchmark.ips do |ips|
  ips.report('simple') do
    API.call env
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
grape-1.2.4 benchmark/simple.rb
grape-1.2.3 benchmark/simple.rb
grape-1.2.2 benchmark/simple.rb
grape-1.2.1 benchmark/simple.rb
grape-1.2.0 benchmark/simple.rb
grape-1.1.0 benchmark/simple.rb
grape-1.0.3 benchmark/simple.rb
grape-1.0.2 benchmark/simple.rb
grape-1.0.1 benchmark/simple.rb
grape-1.0.0 benchmark/simple.rb
grape-0.19.2 benchmark/simple.rb
grape-0.19.1 benchmark/simple.rb
grape-0.19.0 benchmark/simple.rb
grape-0.18.0 benchmark/simple.rb
grape-0.17.0 benchmark/simple.rb
grape-0.16.2 benchmark/simple.rb
grape-0.16.1 benchmark/simple.rb
grape-0.15.0 benchmark/simple.rb
grape-0.14.0 benchmark/simple.rb