Ask Your Question

How do I profile with %lprun in Cocalc?

asked 2017-08-04 17:23:54 +0200

Hi, I'm trying to profile using %lprun in Cocalc, but it says that the decorator is not defined. How do I import it?

Best wishes Isaia

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-08-04 18:25:09 +0200

Found an alternative solution, this snippet does line profiling of f and of the function g called inside f

def f(a,b,c):
     return a,y

from line_profiler import LineProfiler

lp = LineProfiler()
lp_wrapper = lp(f)

s,t = lp_wrapper(a,b,c)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2017-08-04 17:23:54 +0200

Seen: 262 times

Last updated: Aug 04 '17