Guest User

spiderman meme but with cProfile

a guest
May 28th, 2020
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.02 KB | None | 0 0
  1. >>> cProfile('cProfile.run(\'bits_strings(1000, 1000)\')')
  2. Traceback (most recent call last):
  3. File "<stdin>", line 1, in <module>
  4. TypeError: 'module' object is not callable
  5. >>> cProfile.run('cProfile.run(\'bits_strings(1000, 1000)\')')
  6. 1005005 function calls in 0.186 seconds
  7.  
  8. Ordered by: standard name
  9.  
  10. ncalls tottime percall cumtime percall filename:lineno(function)
  11. 1 0.000 0.000 0.780 0.780 <stdin>:1(bits_strings)
  12. 1000 0.001 0.000 0.776 0.001 <stdin>:1(chrs)
  13. 1001 0.001 0.000 0.780 0.001 <stdin>:2(<genexpr>)
  14. 1 0.000 0.000 0.780 0.780 <string>:1(<module>)
  15. 1000000 0.086 0.000 0.086 0.000 {chr}
  16. 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects}
  17. 1000 0.003 0.000 0.003 0.000 {method 'getrandbits' of '_random.Random' objects}
  18. 1000 0.090 0.000 0.771 0.001 {method 'join' of 'str' objects}
  19. 1001 0.004 0.000 0.004 0.000 {range}
  20.  
  21.  
  22. 5 function calls in 0.781 seconds
  23.  
  24. Ordered by: standard name
  25.  
  26. ncalls tottime percall cumtime percall filename:lineno(function)
  27. 1 0.000 0.000 0.781 0.781 <string>:1(<module>)
  28. 1 0.000 0.000 0.781 0.781 cProfile.py:132(run)
  29. 1 0.000 0.000 0.781 0.781 cProfile.py:137(runctx)
  30. 1 0.000 0.000 0.781 0.781 cProfile.py:14(run)
  31. 1 0.781 0.781 0.781 0.781 {method 'enable' of '_lsprof.Profiler' objects}
  32.  
  33.  
  34. >>> def chrs(bits, len_string):
  35. ... return ''.join(chr((bits >> (8*x)) & 0xff) for x in range(len_string))
  36. ...
  37. >>> cProfile.run('cProfile.run(\'bits_strings(1000, 1000)\')')
  38. 2005004 function calls in 0.844 seconds
  39.  
  40. Ordered by: standard name
  41.  
  42. ncalls tottime percall cumtime percall filename:lineno(function)
  43. 1 0.000 0.000 0.846 0.846 <stdin>:1(bits_strings)
  44. 1000 0.001 0.000 0.841 0.001 <stdin>:1(chrs)
  45. 1001000 0.638 0.000 0.733 0.000 <stdin>:2(<genexpr>)
  46. 1 0.000 0.000 0.846 0.846 <string>:1(<module>)
  47. 1000000 0.095 0.000 0.095 0.000 {chr}
  48. 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects}
  49. 1000 0.003 0.000 0.003 0.000 {method 'getrandbits' of '_random.Random' objects}
  50. 1000 0.102 0.000 0.835 0.001 {method 'join' of 'str' objects}
  51. 1001 0.004 0.000 0.004 0.000 {range}
  52.  
  53.  
  54. 5 function calls in 0.846 seconds
  55.  
  56. Ordered by: standard name
  57.  
  58. ncalls tottime percall cumtime percall filename:lineno(function)
  59. 1 0.000 0.000 0.846 0.846 <string>:1(<module>)
  60. 1 0.000 0.000 0.846 0.846 cProfile.py:132(run)
  61. 1 0.000 0.000 0.846 0.846 cProfile.py:137(runctx)
  62. 1 0.000 0.000 0.846 0.846 cProfile.py:14(run)
  63. 1 0.846 0.846 0.846 0.846 {method 'enable' of '_lsprof.Profiler' objects}
Advertisement
Add Comment
Please, Sign In to add comment