Is it my code that's slow or is it python?
Posted by TheKingofStupidness@reddit | learnprogramming | View on Reddit | 8 comments
The app itself runs fine, I created it with python tkinter, I'm still laying the foundation for it and I'm not done with it. But I've been noticing big delays while it launches, 3-8 seconds or so and that's compiling the code, I can launch much heavier apps faster than that!
Strict-Simple@reddit
https://stackoverflow.com/help/how-to-ask
S-for-seeker-9526@reddit
Python is slow i buy the stuff but not that slow! especially with modern hardware.
silvses@reddit
It's a good opportunity learning profiling. Look for something that could implement frequency and length of calls, it could give insight if you have something updating necessarily
https://docs.python.org/3/library/profile.html#introduction-to-the-profilers
Mortomes@reddit
Without knowing anything about what your app does, or seeing any of the code, my educated guess is that it's your code, not python.
TheKingofStupidness@reddit (OP)
Well as I mentioned, it's basically just a gui with no functionality, I was able to bring down the launch time later on, yet not too significant, I'm seriously worried about what will happen when I compile it.
Hawxe@reddit
It’s impossible to say without more info but there’s a 99% chance it’s your code
ToThePillory@reddit
How could anybody know without seeing your code?
BionicVnB@reddit
Usually heavier apps are written in C/C++ et cetera so it's already compiled down to machine code, making it very fast.
In fact CPython is written in, well, C. So the reason that your app is slow may actually come from more than one source, you can try benchmarking your code