Loading screen (using sqlite in it) after pressing button takes too much time

76 views
Skip to first unread message

Mateo Aita

unread,
Jun 10, 2020, 6:27:20 PM6/10/20
to Kivy users support
I have a problem in which, depending on the phone, after pressing a button that opens a "league table", you have to wait up to 4 secs to load it. My guess is that it happens because of the database (sqlite) that make the process of changing screen a bit lagged. Any suggestion?

Elliot Garbus

unread,
Jun 10, 2020, 6:52:43 PM6/10/20
to kivy-...@googlegroups.com

Just some suggestions:

 

  1. Preload the league screen data, prior to opening the screen, so you not doing the access when it is time critical.
  2. Load the data on the on_pre_enter event, this way the load will happen prior to the screen transition animation rather than after it.

 

If the problem is not obvious consider profiling your code, so you know what is taking the time.

--
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/b4d48864-22cb-4ec5-ba4e-20cb2926a937o%40googlegroups.com.

 

Mateo Aita

unread,
Jun 11, 2020, 12:45:37 PM6/11/20
to Kivy users support
I already coded it the second way, i tried to add yout first suggestion but i compared the time it takes to load the screen both ways and i couldn't find any difference. I'm wondering whether the problem is related to sqlite or maybe it could be something close to  the Scrollview and the Mdlists used to display the teams, points, GD, etc?


El miércoles, 10 de junio de 2020, 19:52:43 (UTC-3), Elliot Garbus escribió:

Just some suggestions:

 

  1. Preload the league screen data, prior to opening the screen, so you not doing the access when it is time critical.
  2. Load the data on the on_pre_enter event, this way the load will happen prior to the screen transition animation rather than after it.

 

If the problem is not obvious consider profiling your code, so you know what is taking the time.

 

From: Mateo Aita
Sent: Wednesday, June 10, 2020 3:27 PM
To: Kivy users support
Subject: [kivy-users] Loading screen (using sqlite in it) after pressingbutton takes too much time

 

I have a problem in which, depending on the phone, after pressing a button that opens a "league table", you have to wait up to 4 secs to load it. My guess is that it happens because of the database (sqlite) that make the process of changing screen a bit lagged. Any suggestion?

--
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-...@googlegroups.com.

Elliot Garbus

unread,
Jun 11, 2020, 1:30:13 PM6/11/20
to kivy-...@googlegroups.com

Profiling is described here:  https://kivy.org/doc/stable/api-kivy.app.html#profiling-with-on-start-and-on-stop

 

You could do the profile on just the problem area to better understand what it going on.

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/d2329f4b-dd05-472c-a4ec-d13929c9ea1fo%40googlegroups.com.

 

Mateo Aita

unread,
Jun 11, 2020, 3:27:45 PM6/11/20
to Kivy users support
Thanks Elliot, now i have a document named myapp.profile but honestly, i don't know what to do with it... How do i open it or what am i suposed to do haha? Sorry for being so insistent!

Elliot Garbus

unread,
Jun 11, 2020, 4:23:35 PM6/11/20
to kivy-...@googlegroups.com

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/b6a60e85-53f6-401d-9a30-af79282f722fo%40googlegroups.com.

 

Reply all
Reply to author
Forward
0 new messages