Skip to content
This repository

some worries about the performance? #529

Closed
dahakawang opened this Issue March 18, 2013 · 2 comments

3 participants

David Wang James Tucker Konstantin Haase
David Wang

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?

Konstantin Haase
Collaborator
rkh commented March 19, 2013

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

James Tucker
Owner
raggi commented April 21, 2013

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

James Tucker raggi closed this April 21, 2013
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.