21.12.2022 Views

python_para_desenvolvedores_2ed

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Performance 277

rgb4:

16777220 function calls in 53.618 CPU seconds

Ordered by: standard name

ncalls tottime percall cumtime percall filename:lineno(function)

1 0.624 0.624 53.618 53.618 <string>:1(<module>)

1 48.952 48.952 52.994 52.994 rgbs.py:36(rgb4)

16777216 4.042 0.000 4.042 0.000 {method 'append' of 'list'

objects}

1 0.000 0.000 0.000 0.000 {method 'disable' of

'_lsprof.Profiler' objects}

1 0.000 0.000 0.000 0.000 {range}

rgb5:

16777220 function calls in 32.209 CPU seconds

Ordered by: standard name

ncalls tottime percall cumtime percall filename:lineno(function)

1 6.110 6.110 32.209 32.209 <string>:1(<module>)

16777217 25.636 0.000 26.099 0.000 rgbs.py:48(rgb5)

1 0.000 0.000 0.000 0.000 {method 'disable' of

'_lsprof.Profiler' objects}

1 0.463 0.463 0.463 0.463 {range}

rgb6:

16777219 function calls in 30.431 CPU seconds

Ordered by: standard name

ncalls tottime percall cumtime percall filename:lineno(function)

1 6.066 6.066 30.431 30.431 <string>:1(<module>)

16777217 24.365 0.000 24.365 0.000 rgbs.py:55(rgb6)

1 0.000 0.000 0.000 0.000 {method 'disable' of

'_lsprof.Profiler' objects}

O relatório do cProfile mostra no inicio as duas informações mais importantes:

o tempo de CPU consumido em segundos e a quantidade de chamadas de

função. As outras linhas mostram os detalhes por função, incluindo o tempo

total e por chamada.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!