21.12.2022 Views

python_para_desenvolvedores_2ed

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

276 Performance

print 'rgb6:'

cProfile.run('list(rgb6())')

Saída:

rgb1:

16843012 function calls in 54.197 CPU seconds

Ordered by: standard name

ncalls tottime percall cumtime percall filename:lineno(function)

1 0.633 0.633 54.197 54.197 <string>:1(<module>)

1 49.203 49.203 53.564 53.564 rgbs.py:5(rgb1)

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

objects}

1 0.000 0.000 0.000 0.000 {method 'disable' of

'_lsprof.Profiler' objects}

65793 0.186 0.000 0.186 0.000 {range}

rgb2:

16777219 function calls in 53.640 CPU seconds

Ordered by: standard name

ncalls tottime percall cumtime percall filename:lineno(function)

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

1 49.010 49.010 53.016 53.016 rgbs.py:16(rgb2)

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

objects}

1 0.000 0.000 0.000 0.000 {method 'disable' of

'_lsprof.Profiler' objects}

rgb3:

16777219 function calls in 52.317 CPU seconds

Ordered by: standard name

ncalls tottime percall cumtime percall filename:lineno(function)

1 6.251 6.251 52.317 52.317 <string>:1(<module>)

16777217 46.066 0.000 46.066 0.000 rgbs.py:27(rgb3)

1 0.000 0.000 0.000 0.000 {method 'disable' of

'_lsprof.Profiler' objects}

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

Saved successfully!

Ooh no, something went wrong!