Python Forum
runctx method of cProfile module.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
runctx method of cProfile module.
#1
Define two functions f1 and f2 such that,
f1 returns a list of squares of first 200000 natural numbers using list comprehension.
f2 returns a generator that computes squares of first 200000 natural numbers.
Perform profiling of both the functions and which portions of a function consume more time for computing.
Hint : Make use of runctx method of cProfile module.
Reply


Messages In This Thread
runctx method of cProfile module. - by rahulnatarajan98 - Oct-21-2019, 10:53 AM
RE: runctx method of cProfile module. - by buran - Oct-21-2019, 10:59 AM
RE: runctx method of cProfile module. - by buran - Oct-22-2019, 06:01 AM
RE: runctx method of cProfile module. - by buran - Oct-23-2019, 06:13 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020