Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

some worries about the performance? #529

Closed
dahakawang opened this Issue · 2 comments

3 participants

@dahakawang

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] }
    end

    def call(env)
      to_app.call(env)
    end

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?

@rkh
Owner

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

@raggi
Owner

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.