Skip to content


some worries about the performance? #529

dahakawang opened this Issue · 2 comments

3 participants


hello everyone,
im new to rack, and found it amazing to be such a simple and easy to use library.

recently iv looked in to its code, and find following:

    def to_app
      app = @map ? generate_map(@run, @map) : @run
      fail "missing run or map statement" unless app
      @use.reverse.inject(app) { |a,e| e[a] }

    def call(env)

it seems every time when a new http request arrives the Rack will recreate the middleware stack, what i worry about is if it will have a bad impact on performance? is the recreation necessary?

Official Rack repositories member

I have never run into a case where I was using a Rack::Builder instance as endpoint.

Official Rack repositories member

You are supposed to use the result of to_app as your app.

@raggi raggi closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.