I want to discuss Sanic performance improvements. Since we don’t support Python versions lower than 3.6
In this case, I think it would be cool to think about code optimization, and at this time we will increase our performance in the long term.
For example, in Sanic we have been using
format function in a lot of places. Since Python 3.6 has introduced nice f-strings formatting also it works faster than the standard format function.
And I assume that it would be a nice first step in order to improve Sanic performance.
For example, steps which will be needed(if we decide to do it)
f-stringswhere it is possible, and my suggestion is - start this improvement from
Then replace all
formatfunctions in other modules
(app, router and etc)
Also optimize code where it is possible, for example, to use(list comprehension instead of some
for...loopiteration and etc)
And please, don’t take it as an urgent action;) I’ll be happy to hear your thoughts and etc.
Also, if it sounds good to you,I’d be happy to work on it, and it will be a nice chance to explore Sanic’s source;)