program1:

Line # Mem usage Increment Line Contents
================================================
20 17.664 MiB -0.641 MiB @profile
21 def test1(g):
22 g1 = func()
23 19.070 MiB 1.406 MiB g = map(lambda x, y: x + y, g, g1)

Filename: ./test_memory_usage.py

Line # Mem usage Increment Line Contents
================================================
14 17.664 MiB 0.000 MiB @profile
15 def func():
16 18.305 MiB 0.641 MiB return [1] * dim

Filename: ./test_memory_usage.py

Line # Mem usage Increment Line Contents
================================================
26 16.773 MiB -0.891 MiB @profile
27 def main():
28 17.539 MiB 0.766 MiB g = [0] * dim
29 #g = np.array([0] * dim)
30 17.664 MiB 0.125 MiB for i in xrange(0, 1000):
31 test1(g)
32
33 17.668 MiB 0.004 MiB print 'done'

@-----------------------------------------------------------------------------------------------

program2:

Line # Mem usage Increment Line Contents
================================================
26 16.758 MiB -7.035 MiB @profile
27 def main():
28 17.523 MiB 0.766 MiB g = [0] * dim
29 #g = np.array([0] * dim)
30 23.793 MiB 6.270 MiB for i in xrange(0, 1000):
31 g = test1(g)
32
33 23.797 MiB 0.004 MiB print 'done'

Filename: ./test_memory_usage.py

Line # Mem usage Increment Line Contents
================================================
20 23.793 MiB 0.000 MiB @profile
21 def test1(g):
22 g1 = func()
23 23.793 MiB 0.000 MiB g = map(lambda x, y: x + y, g, g1)
24 23.793 MiB 0.000 MiB return g

Filename: ./test_memory_usage.py

Line # Mem usage Increment Line Contents
================================================
14 23.793 MiB 0.000 MiB @profile
15 def func():
16 23.793 MiB 0.000 MiB return [1] * dim

最新文章

  1. 使用 Spring 进行单元测试
  2. SharePoint2013的头像显示和读取
  3. opengl绘制正弦曲线
  4. JS对文本框值的判断
  5. 一道关于java 类初始化 成员初始化的笔试题的解析
  6. PHP常用的基本文件和目录操作总结
  7. Android 7.0及以上使用OpenCL
  8. SQL实践遇到的知识点
  9. 【java】多态
  10. CAM(Content Addressable Memory)介绍
  11. 自己写的browse.bat与perl写的url_handler.pl的比较
  12. Linux命令02--系统管理
  13. Java编程的逻辑 (18) - 为什么说继承是把双刃剑
  14. Mycat读写分离、主从切换学习(转)
  15. Spring Boot 在IDEA中debug时的hot deployment(热部署)
  16. PHP将CMYK颜色值和RGB颜色相互转换的例子
  17. VC++中关于控件重绘函数/消息 OnPaint,OnDraw,OnDrawItem,DrawItem的区别
  18. Linux Jenkins配置Git
  19. Strategic Game--hdu1054(最小覆盖点)
  20. 快速解决Kali 更新失败问题

热门文章

  1. cidaemon.exe过程cpu入住率和关闭cidaemon.exe加工方法
  2. Java反射探索研究(转)
  3. 从控制台读取password - C#
  4. Phone Number 2010年山东省第一届ACM大学生程序设计竞赛
  5. swing中几种layout示例(转)
  6. JFrame、JDialog close
  7. JSON.stringify 语法解释
  8. BZOJ 3236 AHOI 2013 作业 莫队算法
  9. Apple Watch 1.0 开发介绍 1.4 简介 使用iOS技术
  10. GotoTest