The app works on 3GS, but slower on 3G

I am new to computer coding and have just finished coding the application and tested it on both 3G and 3GS. In 3GS, it worked fine, like on a simulator. However, when I tried to launch it on 3G, the application becomes very slow. I am not sure what the reason is, and I hope that someone can shed light on me.

As a rule, in my application there are several classes of the view controller, and one of them is the cover page, one of which is the main page, one is the settings, etc. I used the resolution to go from the cover page to the main page, But even this simple transition shows unstable performance on 3G! My other part of the application involves zooming in on some images by zooming in on images, switching images by tapping or spreading on receiving touch events, saving photos to the photo library and saving and retrieving some photos in a folder, as well as some data in the SQlite database, each of which shows nonsmooth actions.

Compared to a heavy graphical or heavy math application, I find mine quite simple. I absolutely do not understand why the application will behave so slowly and unevenly, which is hardly useful for 3G. Any help / direction would be highly appreciated. Thanks for the help.

+4
source share
4 answers

OK, finally found the problem and got the solution. The problem was that I have about a dozen transparent images lying on top of each other to form my main view. Therefore, when in any animation the system should redraw on each separate layer and calculate their transparent effect and so on. (actually I'm not quite sure, but this is what I think)

The solution I have is to create a temporary composite view containing all of them, and place the composite as an image in full screen before starting any animation. This delays the onset of fading, but in itself becomes much smoother.

0
source

You can try profiling your application with Shark to find out where performance bottlenecks are.

+6
source

I don’t know how appropriate this is for your business, but my game (shameless plugin) MultiMaze is quite undemanding graphically, and worked fine on my 3GS. But when I tried it on 3G, the frame rate dropped to glacial 10-20 frames per second. I put the entire code base from CoreGraphics into OpenGL ES, and that changed the world. Now it works at the limit (60 frames per second) on my 3GS and is very close to it on 3G.

+1
source

Do you use a lot of memory? 3G has 128 MB and 3GS has 256 MB.

Do you get memory alerts? In my debug builds, I have an NSLog in didReceiveMemoryWarning, so I see when / when I get warnings.

EDIT: Check the size of your photos, are they resized for the iPhone screen or are they original?

+1
source

Source: https://habr.com/ru/post/1308351/


All Articles