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 2bf2c1a + bfe7d5c commit b3ab0a8Copy full SHA for b3ab0a8
benchmark/compile_many_routes.rb
@@ -0,0 +1,25 @@
1
+# frozen_string_literal: true
2
+
3
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
4
+require 'grape'
5
+require 'benchmark/ips'
6
+require 'grape/eager_load'
7
8
+Grape.eager_load!
9
10
+class API < Grape::API
11
+ prefix :api
12
+ version 'v1', using: :path
13
14
+ 2000.times do |index|
15
+ get "/test#{index}/" do
16
+ 'hello'
17
+ end
18
19
+end
20
21
+Benchmark.ips do |ips|
22
+ ips.report('Compiling 2000 routes') do
23
+ API.compile!
24
25
0 commit comments