Python optimization #1156
Replies: 5 comments
|
Not sure if this is mentioned in one of those links, but you can use make sure you don't spend to much time optimizing things that are negligible to the rest of the program |
|
Also, here's a really simple (untested) decorator that logs the runtime of a function after it's run. With a few project-specific modifications it may be useful import time
def time_fn[F](fn: F) -> F:
def out(*args, **kwargs):
start = time.perf_counter()
fn(*args, **kwargs)
end = time.perf_counter()
logger.log(f'{fn.__name__} took {end - start} seconds')
return out |
|
Hi @kzndotsh is this issue still open, if yes then what is the requirement would like to contribute on this. |
Yes, it's still open. What do you mean by "requirement"? The issue is pretty wide open more as a discussion at the moment I suppose so I'm open to any direction/small changes or other issues can be made. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Figure out how to optimize where possible at a lower level and explore areas for improvement
All reactions