How to profile a nicegui app? #2533
Replies: 2 comments 2 replies
-
Hi @Karim-Ghibli, I'm not sure if profiling
|
Beta Was this translation helpful? Give feedback.
-
@falkoschindler Is there a way to disable multiprocessing in ui.run just for profiling? I want to profile my app startup times. I don't want yappi or LineProfiler, I don't want new third party modules. I just want basic built-in python profiling that I already know how to use. Attempts So FarI tried something similar to OP. Launching my app with
The error could be multiprocessing related. I disable multiprocessing in my own apps when I need to profile. Error message
|
Beta Was this translation helpful? Give feedback.
-
Question
Is there a way to profile a nicegui app?
I have a small personal use app and it has some serious performance issues and wanted to see which functions (whether some ui component creation/actions or maybe my own code of the data model) were slowing it down the most.
I am mostly a Python guy, so what I have tried so far is just using cProfile, from command line and from the script itself like so:
And of course that didn't work, with "NameError: name 'ui' is not defined".
I also tried
and
and those didn't work either.
I know that basically this is a framework so it's not as if I am directly executing the code, but I was hoping that there was a relatively easy way to profile nicegui apps (even if not with cProfile)?
Beta Was this translation helpful? Give feedback.
All reactions