We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5154b36 + 46ab658 commit 46f54e4Copy full SHA for 46f54e4
benchmark/simple.rb
@@ -0,0 +1,31 @@
1
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+require 'grape'
3
+require 'benchmark'
4
+
5
+class API < Grape::API
6
+ prefix :api
7
+ version 'v1', using: :path
8
+ get '/' do
9
+ 'hello'
10
+ end
11
+end
12
13
+options = {
14
+ method: 'GET'
15
+}
16
17
+env = Rack::MockRequest.env_for('/api/v1', options)
18
19
+10.times do |i|
20
+ env["HTTP_HEADER#{i}"] = '123'
21
22
23
+iters = 5000
24
25
+Benchmark.bm do |bm|
26
+ bm.report('simple') do
27
+ iters.times do
28
+ API.call env
29
30
31
0 commit comments