mirror of
https://github.com/krateng/maloja.git
synced 2025-07-09 03:04:07 -04:00
Profiler changes
This commit is contained in:
parent
f10e22e6a0
commit
8bb6d9d7ad
@ -28,10 +28,14 @@ def profile(func):
|
|||||||
if FULL_PROFILE:
|
if FULL_PROFILE:
|
||||||
profiler.disable()
|
profiler.disable()
|
||||||
|
|
||||||
log(f"Executed {func.__name__} ({args}, {kwargs}) in {clock.stop():.2f}s",module="debug_performance")
|
seconds = clock.stop()
|
||||||
|
realfunc = func
|
||||||
|
while(hasattr(realfunc,'__innerfunc__')):
|
||||||
|
realfunc = realfunc.__innerfunc__
|
||||||
|
log(f"Executed {realfunc.__name__} ({args}, {kwargs}) in {seconds:.2f}s",module="debug_performance")
|
||||||
if FULL_PROFILE:
|
if FULL_PROFILE:
|
||||||
try:
|
try:
|
||||||
pstats.Stats(profiler).dump_stats(os.path.join(benchmarkfolder,f"{func.__name__}.stats"))
|
pstats.Stats(profiler).dump_stats(os.path.join(benchmarkfolder,f"{realfunc.__name__}.stats"))
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user