3

I am wondering what options I have to speed up kivy after I package it.

I was looking into cython and pypy because those should speed up python. Also, I was reading that kivy can be a little slower and bigger than most android applications because it includes python and the interpreter. I usually just search around forever until i find an answer but it can be hard to find things about kivy.

Can anyone with experience recommend something to get better speeds out of this framework? I'm dealing with a lot of code so it could be cumbersome testing a lot of this stuff out.

edit: 132137 asked Nov 24 '17 at 19:13

I have a lot of this application packaged now. I wouldn't so much worry about cython until you are packaging it. I would also try to package the application incrementally to make sure everything works. More than anything, I was just really worried about how things would go when I started packaging it. I should have started earlier. The size hasn't been too much of an issue. I would try and write it on ubuntu or a linux distribution(buildozer doesn't work with windows) and not everything will run the same cross all platforms(I had some issues with some of the modules I was working with). I love kivy this is like an eli5 thing I wish I'd known at the time.

After messing around with it some I got it down to 16mb. So I'm really happy with the framework. I guess i didn't need to include the buildozer folder in the build. I'm new to programming but I'm pretty happy with how everything turned out.

1 Answers1

5

When it comes to responsiveness, make sure your python code is optimised. That means doing things like not loading Screens or other widgets until you need them (or even doing it in the background as much as possible).

For speeding up python itself, the main supported method is cython. python-for-android does not support pypy.

kivy can be a little slower and bigger than most android applications because it includes python and the interpreter.

A basic Kivy-using APK is about 7MB. And the delay from starting the interpreter manifests largely during the startup of the application, which can take a few seconds, especially on older devices.

inclement
  • 29,124
  • 4
  • 48
  • 60
  • Thanks. This is going to save me a ton of time. I started installing pypy yesterday so I am glad I found out before i added a bunch of modules to it. I was a little worried about what would happen after I installed the application. I put a lot of effort into it so that's something that you kind of worry about. It will be easier to reduce the amount of code that loads at startup now than if i had to rewrite everything. I should probably write some of the screens in python. – NeuroticHamster Nov 25 '17 at 16:43