Working on blueprint local middleware

Hello everyone!
I’ve suprisingly found, as many others, that blueprints middlewares are global https://github.com/huge-success/sanic/issues/37.
So I started digging into that specific problem.

I have several questions -

  1. Is there specific optimizations I should aware of? It looks like for middlewares is used list of functions (global) - is this for optimization? Is it OK to store Blueprints object and have local middlewares attached to it?
  2. In app.py I’ve found self._blueprint_order.append(blueprint) - it registers blueprint objects and never is used elsewhere. Am I missing something?