Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bad performance after building for iOS instead of Android

Discussion in 'iOS and tvOS' started by AlexFormoso, Jul 15, 2015.

  1. AlexFormoso

    AlexFormoso

    Joined:
    Aug 12, 2012
    Posts:
    25
    Hello all!. I made a 2D game similar to Whack-A-Mole using Unity 5.1. Its a really simple game, so no CPU overusing or anything like that. I tested it using a Samsung Galaxy S3 Mini (low-end phone) and got a goodperformance out of it, really nice constant 30fps. I took that same project, and built it for iOS (after adding some compiler flags for ARC thanks to facebook SDK) and I have horrible performance in an iPhone 4S. If the Hardware on the iPhone is really superior, why am I getting such a bad performance?

    Xcode Gives 0 errors and 300 warnings but I've been told that's pretty normal when using unity.

    Any leads on what could be causing this?


    EDIT: I posted the same on Unity Answers but if its not a extremely common question, Answers is useless.
     
  2. jldevoy

    jldevoy

    Joined:
    May 2, 2014
    Posts:
    33
    Try scaling the IOS resolution down.
     
  3. _Paulius

    _Paulius

    Mobile Developer Unity Technologies

    Joined:
    Jul 8, 2014
    Posts:
    173
    Hey Alex,

    You could check whether there are any processes that might be consuming excessive amounts of CPU/GPU time by attaching the profiler and you could also try recording a GPU frame from Xcode (Debug/Capture GPU frame).

    If you find anything suspicious please submit a bug report (just be sure to post the bug id here so that we wouldn’t miss it).
     
  4. AlexFormoso

    AlexFormoso

    Joined:
    Aug 12, 2012
    Posts:
    25

    Well there are few weird things happening. After the deployment I cant see the Unity Splash Screen on the IPhone 4S, I have a Singleton as a game manager (pretty common practice) and some objects cant read it. t has Unity Ads integrated but the iPhone doesn't even bother on trying to load them up. I did a GPU Frame Capture and everything seems normal, 22 Draws, 30.3 fps. Constant Smooth 30fps according to the XCODE Profiler, CPU goes all the way to 100% when loading a scene then stabilizes at 20% in the whole game, memory usage is about 40Mb in the heaviest of the scenes and Zero network and disk usage.

    And the behaviors are weirder because I use the Canvas Scaler for smaller screens and it works like a charm on Android and on iOS some UI elements are displaced. Should I report this as a bug?
     
  5. _Paulius

    _Paulius

    Mobile Developer Unity Technologies

    Joined:
    Jul 8, 2014
    Posts:
    173
    So do you still have the performance issues then? You did mention that you were also getting 30fps on Android?

    But still if the Canvas Scaler and the Unity Ads plugin are behaving differently on iOS than on Android I think it might be worth submitting a bug report, so that we could figure out what might be causing this.