57 ms·
It's not always an option, but simply using PyPy can massively reduce memory usage without needing to change your code at all. The PyPy site links to this blog
by Deimorz 7y ago
It's not always an option, but simply using PyPy can massively reduce memory usage without needing to change your code at all.
The PyPy site links to this blog post (from 10 years ago) with some info: https://morepypy.blogspot.com/2009/10/gc-improvements.html https://morepypy.blogspot.com/2009/10/gc-improvements.html
And a quick search found this relatively recent post that does some measurement of it: https://dev.nextthought.com/blog/2018/08/cpython-vs-pypy-memory-usage.html https://dev.nextthought.com/blog/2018/08/cpython-vs-pypy-mem...
- intellimath 7y agoIn the article consider aproach with the `dataobject` from `recordclass` library as a base object in class definition. This seem can produce less memory than PyPy.