zoukankan      html  css  js  c++  java
  • tmp1

    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

  • 相关阅读:
    [EOJ]2019 ECNU XCPC March Selection #1
    [模板]宏定义
    [POJ]poj1961,poj2406(KMP)
    [模板]KMP
    [CF]Avito Cool Challenge 2018
    [CF]Codeforces Round #528 Div.2
    [POJ]POJ1328(贪心)
    洛谷 P3808 【模板】AC自动机(简单版) 题解
    中科院的难题 题解
    【转】洛谷 P3722 [AH2017/HNOI2017]影魔 题解
  • 原文地址:https://www.cnblogs.com/foreveryl/p/3659257.html
Copyright © 2011-2022 走看看