You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Middlewares are expensive. The HEAD middleware can be removed because we're already at the point where we decide on the content or not in the core. There's no point to avoid a single if statement in order to add another wrapped subroutine.
Note the work I've done on optimizing Dancer2 - it involved removing several middlewares. This is another we don't need.
The text was updated successfully, but these errors were encountered:
I tried implementing this quickly and as a reference, here are the benchmark results:
# Before (with Head Middleware)
8.5624e-01 +/- 6.8e-04 (0.1%)
# After (implementing it in core)
8.5342e-01 +/- 8.3e-04 (0.1%)
Doesn't seem big.
However, if I completely remove the FixMissingBodyInRedirect middleware (just to see how heavy it is), combined with the reimplementation of the Head middleware, we get:
8.2836e-01 +/- 3.0e-04 (0.0%)
Which is now approaching interesting. Not interesting enough though, because we would still have to implement that middleware, which doesn't seem trivial.
In short, for now I don't see a lot of value in removing either middleware.
Middlewares are expensive. The
HEAD
middleware can be removed because we're already at the point where we decide on the content or not in the core. There's no point to avoid a singleif
statement in order to add another wrapped subroutine.Note the work I've done on optimizing Dancer2 - it involved removing several middlewares. This is another we don't need.
The text was updated successfully, but these errors were encountered: