[Python-Dev] Investigating Python memory footprint of one real Web application
songofacandy at gmail.com
Fri Jan 20 05:49:01 EST 2017
After reading Instagram's blog article , I’m thinking about how
Python can reduce memory usage of Web applications.
My company creating API server with Flask, SQLAlchemy and typing.
(sorry, it's closed source).
So I can get some data from it's codebase.
Report is here
My thoughts are:
* Interning (None,) seems worth enough.
* There are many empty dicts. Allocating ma_keys lazily may reduce
* Most large strings are docstring. Is it worth enough that option
for trim docstrings, without disabling asserts?
* typing may increase memory footprint, through functions
__attributes__ and abc.
* Can we add option to remove or lazy evaluate __attributes__ ?
* Using string literal for annotating generic type may reduce WeakRef usage.
* Since typing will be used very widely in this year. Need more
More information about the Python-Dev