python gc基准测试套件
python-gc-benchmark的Python项目详细描述
python gc基准
这是一个专注于内存使用的python基准测试套件。这些场景是为那些想要分析不同python版本的内存使用情况的人而设计的内存密集型程序选择的。
该套件支持python 2、python 3、pypy2和pypy3。
实施标准
基准测试的特点是程序对内存的需求很大,而且大多是数组密集型程序,如科学计算问题、一些游戏和其他容器密集型的通用程序。
考虑的主要指标是驻留集大小(rss),它是为程序分配的内存。选择此选项是因为;
- 它是独立于机器的。尽管程序在64位计算机上使用的内存比32位计算机多。
- 扩展内存管理器,因为它给它带来了很大的压力。
限制
对于多线程程序,常驻集大小的度量似乎超出了报告范围。在两个线程共享内存的情况下,所报告的rss包括每个线程对该内存的单独内存使用。
因此,此度量不适用于多处理和多线程程序。
未来工作
- 添加其他有用的命令。
- 增加更多的科学基准。
从源代码运行基准
git clone http://gitlab.casa.cs.unb.ca/jnanjeky/python_gc_benchmark
cd python-gc-benchmark
python setup.py install
python-gc-benchmark -o <filename> <benchmark>
# or:
python-gc-benchmark -o <filename> all
从pypi下载
pip install python-gc-benchmark
python-gc-benchmark -o <filename> <benchmark>
# or:
python-gc-benchmark -o <filename> all
参考文献
https://github.com/nuprl/retic_performancehttps://github.com/python/pyperformancehttp://www.marinamele.com/7-tips-to-time-python-scripts-and-control-memory-and-cpu-usage