luislavena/bench-micro — pull request #11 by jeremyevans (2014-08-10 08:42:26+00:00)
Title: Try to make benchmarks fair

Currently, the benchmarks are not fair because some apps return a 200 for
all requests, and other apps return 200 only for GET /. The apps that return
200 only for GET / obviously have to do more work, so they shouldn't get
penalized for it.

This fixes the following issues:

* The cuba, rack, and rack-response apps all return 200 for all requests, not
just GET /.
* The mustermann app returns 200 for any request method with /, not just GET /.
* The lotus-router app doesn't return a rack response that is valid according
to Rack::Lint.

This also removes unused routes from the lotus-router and mustermann apps.

Note that I didn't do an exhaustive check of all apps, there may be others
that also have similar issues (gin and ramaze don't check the request method
from the looks of it).

This pull request doesn't include this, but I recommend adding some tests
that all apps must pass before benchmarking:

* GET / returns 200
* GET /foo returns 404
* POST / returns 404 or 405
* Rack::Lint passes for all 3 of the above requests
* Possibly that all apps return a correct Content-Length header for the body

The alternate approach here is that all apps are allowed to return 200 for all
requests (or 200 for both GET / and POST / and 404 for others), in which case
I'll submit a different pull request.