issues with kivy speed

20 views
Skip to first unread message

Diego Fernando Pedraza Cardenas

unread,
Dec 18, 2020, 11:01:56 PM12/18/20
to Kivy users support
I am currently developing a software with kivy and python, this software needs to be executing many tasks simultaneously all the time (reading sensors, protections, online graphics, events, modbus tcp communication, etc), for this I use threads and while loops, But I'm at a point where the screen is too slow to update the data and move between screens, the truth is that the code currently has more than 50 thousand lines (among all the libraries) and it works well but the interface does not respond as I would like. Do you have any suggestions to optimize the speed of kivy?

Elliot Garbus

unread,
Dec 19, 2020, 12:47:33 AM12/19/20
to kivy-...@googlegroups.com
Start by profiling your code to understand where time is being spent. Then you can focus your optimizations. 
Rather than running threads all the time and using while loops, you should use the Clock.schedule_interval() to schedule running these background tasks.  

It may make sense to use multiprocessing for some tasks. 


Sent from my iPad

On Dec 18, 2020, at 9:02 PM, Diego Fernando Pedraza Cardenas <diegoped...@gmail.com> wrote:


I am currently developing a software with kivy and python, this software needs to be executing many tasks simultaneously all the time (reading sensors, protections, online graphics, events, modbus tcp communication, etc), for this I use threads and while loops, But I'm at a point where the screen is too slow to update the data and move between screens, the truth is that the code currently has more than 50 thousand lines (among all the libraries) and it works well but the interface does not respond as I would like. Do you have any suggestions to optimize the speed of kivy?

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/e2387eff-6123-4a87-901e-9c3a6035824do%40googlegroups.com.

diegoped...@gmail.com

unread,
Dec 19, 2020, 11:43:47 AM12/19/20
to Kivy users support

only changing the threads for clock.schedule improved in an incredible way, really thank you very much  

Elliot Garbus

unread,
Dec 19, 2020, 11:58:14 AM12/19/20
to kivy-...@googlegroups.com

Thanks for letting me know how it worked out.  😎

Reply all
Reply to author
Forward
0 new messages