> This page is very out-of-date and has some inconsistencies with current versions
The following block of code is profiled by :pycProfile
:
../tool/profQCLayers.py
where PQLiu.json is the following file:
../ErwinJr2/example/PQLiu.json
ncalls | tottime | percall | cumtime | percall | filename:lineno(function) |
---|---|---|---|---|---|
|
0.001 | 0.001 | 5.955 | 5.955 | ./ErwinJr2/QCLayers.py:1493(auto_gain) |
|
0.000 | 0.000 | 4.753 | 4.753 | ./ErwinJr2/QCLayers.py:1386(full_population) |
|
0.024 | 0.024 | 4.753 | 4.753 | ./ErwinJr2/QCLayers.py:921(full_population) |
|
1.358 | 0.000 | 3.361 | 0.001 | ./ErwinJr2/QCLayers.py:701(_ifr_transition) |
|
0.014 | 0.000 | 1.545 | 0.000 | ./ErwinJr2/QCLayers.py:433(psi_overlap) |
|
0.316 | 0.000 | 1.531 | 0.000 | {built-in method builtins.sum} |
|
0.038 | 0.000 | 1.367 | 0.000 | ./ErwinJr2/QCLayers.py:621(_lo_transition) |
|
0.292 | 0.000 | 1.216 | 0.000 | ./ErwinJr2/QCLayers.py:437(<genexpr>) |
|
0.090 | 0.000 | 1.024 | 0.000 | ./ErwinJr2/QCLayers.py:273(_shift_psi) |
|
0.012 | 0.000 | 0.935 | 0.000 | <__array_function__ internals>:2(interp) |
|
0.015 | 0.000 | 0.914 | 0.000 | [.python-packages]/numpy/lib/function_base.py:1289(interp) |
|
0.871 | 0.000 | 0.871 | 0.000 | {built-in method numpy.core._multiarray_umath.interp} |
|
0.783 | 0.000 | 0.800 | 0.000 | ./ErwinJr2/OneDQuantum/OneDSchrodinger.py:144(cLOphononScatter) |
|
0.017 | 0.017 | 0.678 | 0.678 | ./ErwinJr2/QCLayers.py:1394(full_gain_spectrum) |
|
0.078 | 0.000 | 0.656 | 0.000 | ./ErwinJr2/QCLayers.py:587(_dipole) |
|
0.002 | 0.002 | 0.513 | 0.513 | ./ErwinJr2/QCLayers.py:322(solve_whole) |
|
0.036 | 0.036 | 0.510 | 0.510 | ./ErwinJr2/QCLayers.py:344(_solve_whole_ode) |
|
0.469 | 0.469 | 0.469 | 0.469 | ./ErwinJr2/OneDQuantum/OneDSchrodinger.py:101(cBandSolve1D) |
|
0.372 | 0.000 | 0.372 | 0.000 | ./ErwinJr2/QCLayers.py:732(interpZ) |
|
0.062 | 0.000 | 0.355 | 0.000 | <__array_function__ internals>:2(argmax) |
|
0.281 | 0.000 | 0.281 | 0.000 | ./ErwinJr2/QCLayers.py:993(_xBandMassInv) |
|
0.005 | 0.000 | 0.248 | 0.000 | <__array_function__ internals>:2(trapz) |
|
0.169 | 0.000 | 0.237 | 0.000 | [.python-packages]/numpy/lib/function_base.py:4006(trapz) |
|
0.053 | 0.000 | 0.234 | 0.000 | [.python-packages]/numpy/core/fromnumeric.py:1114(argmax) |
|
0.059 | 0.000 | 0.182 | 0.000 | [.python-packages]/numpy/core/fromnumeric.py:52(_wrapfunc) |
|
0.002 | 0.000 | 0.138 | 0.000 | <__array_function__ internals>:2(gradient) |
|
0.101 | 0.000 | 0.129 | 0.000 | [.python-packages]/numpy/lib/function_base.py:802(gradient) |
|
0.103 | 0.000 | 0.103 | 0.000 | {method 'argmax' of 'numpy.ndarray' objects} |
|
0.005 | 0.000 | 0.063 | 0.000 | {method 'sum' of 'numpy.ndarray' objects} |
|
0.058 | 0.000 | 0.058 | 0.000 | ./ErwinJr2/QCLayers.py:1247(layerVc) |
|
0.003 | 0.000 | 0.058 | 0.000 | [.python-packages]/numpy/core/_methods.py:45(_sum) |
|
0.056 | 0.000 | 0.056 | 0.000 | {method 'reduce' of 'numpy.ufunc' objects} |
|
0.006 | 0.000 | 0.021 | 0.000 | <__array_function__ internals>:2(iscomplexobj) |
Before optimizing code performamce, there are 814603 function calls taking 10.835 seconds in total. The output of :pycProfile
sorted by cumulative time is listed in the following table.
ncalls | tottime | percall | cumtime | percall | filename:lineno(function) |
---|---|---|---|---|---|
|
|
|
|
|
QCLayers.py:425(calc_FoM) |
|
|
|
|
|
QCLayers.py:383(loTransition) |
|
|
|
|
|
QCLayers.py:419(loLifeTime) |
|
|
|
|
|
QCLayers.py:422(<listcomp>) |
|
|
|
|
|
fromnumeric.py:1821(sum) |
|
|
|
|
|
fromnumeric.py:64(_wrapreduction) |
|
|
|
|
|
{method 'reduce' of 'numpy.ufunc' objects} |
|
|
|
|
|
{built-in method builtins.abs} |
|
|
|
|
|
QCLayers.py:260(solve_whole) |
|
|
|
|
|
OneDSchrodinger.py:61(cSimpleSolve1D) |
|
|
|
|
|
{built-in method builtins.isinstance} |
|
|
|
|
|
{method 'items' of 'dict' objects} |
|
|
|
|
|
QCLayers.py:178(populate_x) |
|
|
|
|
|
QCLayers.py:169(avghwLO) |
|
|
|
|
|
OneDSchrodinger.py:74(cSimpleFillPsi) |
|
|
|
|
|
{built-in method builtins.sum} |
|
|
|
|
|
QCLayers.py:227(<listcomp>) |
|
|
|
|
|
QCLayers.py:173(<genexpr>) |
ErwinJr2.QCLayers
After optimizing code performance by replace most time consuming function call (:pyQCLayers.loLifeTime
), by C code and add openMP support, there are 3613 function calls taking 1.255 seconds in total. The output of :pycProfile
sorted by cumulative time is listed in the following table.
ncalls | tottime | percall | cumtime | percall | filename:lineno(function) |
---|---|---|---|---|---|
|
|
|
|
|
QCLayers.py:427(calc_FoM) |
|
|
|
|
|
QCLayers.py:383(loTransition) |
|
|
|
|
|
OneDSchrodinger.py:113(cLOphononScatter) |
|
|
|
|
|
QCLayers.py:421(loLifeTime) |
|
|
|
|
|
QCLayers.py:424(<listcomp>) |
|
|
|
|
|
QCLayers.py:260(solve_whole) |
|
|
|
|
|
OneDSchrodinger.py:65(cSimpleSolve1D) |
|
|
|
|
|
QCLayers.py:178(populate_x) |
|
|
|
|
|
fromnumeric.py:1821(sum) |
|
|
|
|
|
QCLayers.py:169(avghwLO) |
|
|
|
|
|
{built-in method builtins.sum} |
|
|
|
|
|
OneDSchrodinger.py:78(cSimpleFillPsi) |
|
|
|
|
|
fromnumeric.py:64(_wrapreduction) |
|
|
|
|
|
{method 'reduce' of 'numpy.ufunc' objects} |
|
|
|
|
|
QCLayers.py:173(<genexpr>) |
|
|
|
|
|
ctypeslib.py:196(from_param) |
|
|
|
|
|
QCLayers.py:227(<listcomp>) |
|
|
|
|
|
{built-in method numpy.core.multiarray.array} |