Ask Your Question

Revision history [back]

Different runtime programs

Hello!Why does the speed of performance of functions differ depending on where they are launched?If I run in the console - program runs faster than in IDE (I use Wing Pro)Example.Execution time in console:3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40)_________________________________forLoop : 1.8672226498562265 =>_________________________________listComp : 1.0452214996682148 =>_________________________________mapCall : 0.5306503870825039 =>_________________________________genExpr : 1.427833488166335 =>_________________________________genFunc : 1.4664546781685468 =>Execution time in IDE:3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40)_________________________________forLoop : 4.45649404998894 =>_________________________________listComp : 1.9458866622428665 =>_________________________________mapCall : 0.5576458305684584 =>_________________________________genExpr : 12.455734571997347 =>_________________________________genFunc : 12.939494802034947 =>I use a small functiondef timer(func, pargs, *kargs):        start = time.clock()        for i in repslist:                ret = func(pargs, *kargs)        elapsed = time.clock() - start        return (elapsed, ret)Start of program executionstart = time.clock()And how much time is spentelapsed = time.clock() - startFor some reason, different execution times in the console and IDE

Different runtime programs

Hello!Why does the speed of performance of functions differ depending on where they are launched?If launched? If I run in the console - program runs faster than in IDE (I use Wing Pro)Example.Execution Pro) Example.

Execution time in console:3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40)_________________________________forLoop 06:54:40)
forLoop : 1.8672226498562265 =>_________________________________listComp 1.8672226498562265
listComp : 1.0452214996682148 =>_________________________________mapCall 1.0452214996682148
mapCall : 0.5306503870825039 =>_________________________________genExpr 0.5306503870825039
genExpr : 1.427833488166335 =>_________________________________genFunc 1.427833488166335
genFunc : 1.4664546781685468 =>Execution 1.4664546781685468

Execution time in IDE:3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40)_________________________________forLoop 06:54:40)
forLoop : 4.45649404998894 =>_________________________________listComp 4.45649404998894
listComp : 1.9458866622428665 =>_________________________________mapCall 1.9458866622428665
mapCall : 0.5576458305684584 =>_________________________________genExpr 0.5576458305684584
genExpr : 12.455734571997347 =>_________________________________genFunc 12.455734571997347
genFunc : 12.939494802034947 =>I 12.939494802034947

I use a small functiondef function

def timer(func, pargs, *kargs):  *pargs, **kargs):
        start = time.clock()  time.clock()
        for i in repslist:  repslist:
                ret = func(pargs, *kargs)  func(*pargs, **kargs)
        elapsed = time.clock() - start  start
        return (elapsed, ret)Start of program executionstart = time.clock()And how much time is spentelapsed = time.clock() - startFor ret)

For some reason, different execution times in the console and IDE

Different runtime programs

Hello!Why does the speed of performance of functions differ depending on where they are launched? If I run in the console - program runs faster than in IDE (I use Wing Pro) Example.

Execution time in console:3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40)
forLoop : 1.8672226498562265
listComp : 1.0452214996682148
mapCall : 0.5306503870825039
genExpr : 1.427833488166335
genFunc : 1.4664546781685468

Execution time in IDE:3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40)
forLoop : 4.45649404998894
listComp : 1.9458866622428665
mapCall : 0.5576458305684584
genExpr : 12.455734571997347
genFunc : 12.939494802034947

I use a small function

def timer(func, *pargs, **kargs):
        start = time.clock()
        for i in repslist:
                ret = func(*pargs, **kargs)
        elapsed = time.clock() - start
        return (elapsed, ret)

For some reason, different execution times in the console and IDE