Performance hit for iOS?

Hello all, after a few busy months at work I have returned to a mobile project of mine and have opted to use the new UI instead of my previous custom UI set up.
The new UI works as intended for android, however loading up the canvas appears to take ~6 seconds on an iPhone 4s device.
The UI in question is very simple and consists of a panel, a text object and 3 buttons. I am also using the scaler component to ensure uniformity between resolutions.

Has anyone else suffered issues like this and if so is this a known bug/issue?

I have pretty complex canvases in my game and I never had problems like that. They all load pretty fast. Also testing on iPhone 4S.

How about the performance after it finishes loading? Most probably the problem is somewhere else.

Thanks for your reply.
Performance is fine after the UI loads, and the 6 second lag is only presented on the first occurrence of the UI, sequential occurrences offer not lag at all.

It’s an unknown issue, so if you’re unsure, or using metal, it’s probably a good idea to report a bug. You’ve given us no information to work with so report a bug and leave much more detailed information here.

Hi Hippocoder, I am planning on reporting a bug if i am unable to solve the issue, as i would prefer to not further burden the dev team with redundant bug reports.

Ill post as much information as i can.

The 2D game involves controlling a sprite and avoiding obstacles, which are other 2D sprites with 2D colliders attached. Upon colliding with an obstacle, the user is presented with the “Game Over” overlay which is simply a canvas overlay.

the set-up of the UI elements is as follows:

Each element has default values and components with the exception of text and the inclusion of the Canvas Scaler component which is currently set to scale with screen size at a reference resolution of 250x600 (width matching).

Within the start() function, a call is placed to disable this canvas object:

void Start ()
    {
        ...
        EndScreen.SetActive(false);
        ...
    }

after a collision event is raised, the call to OnTriggerEnter2D enables the menu, as such:

void OnTriggerEnter2D(Collider2D other)
    {
        ...
        if (other.name == "obstacle")
        {
            ....
            EndScreen.SetActive(true);
            ....
        }
        ....
    }

So as you can see, it is all very straight forward and works perfectly in the editor and on various Android testing devices, however on an iPhone 4S, the first time the menu triggered, there is a delay of 6 seconds, after which the menu can be triggered multiple times with no lag.

During testing i have even set the canvas to be enabled with the Start() function, to ensure the issue was not related to the computation of collision date etc. having the menu enabled in Start() results in the level loading being blocked for ~6 seconds, so the issue is limited to the actual rendering time of the canvas from what i can see. I do not have iOS pro so i currently cannot profile the performance from the device.

Hope that straightens out the issue i am facing.

1 Like

People keep saying this :slight_smile: it’s never a burden - Unity has a robust QA system in place and more is always better :slight_smile:

Regarding your issue, I really cannot see an issue here at all. The 4S is a more than capable device, so I wonder if it would be a spike in garbage, or perhaps the device simply has been left on too long and is running too many apps. Have you tried a hard reset of it just to see if that’s an issue? In any case - please report.

Is it Unity 4.x?

I work in QA so i always try to avoid passing off my issues ;).
Yes i have tried several hard resets and I am currently using 4.6.1f1. to confirm i have deleted each UI element one by one and retested, the issue was relieved by deleting the Canvas element, i am going to quickly test if it is due to the Canvas Scaler, after which i shall zip up my project for the QA team.

Many thanks for your help hippocoder.

1 Like

Oddly, after deleting the canvas and recreating it, everything seems to be ok, so i can only presume there was an issue with importing the project data from the android platform.

I am having a similar issue. deleting and recreating the canvas did not work for me unfortunately.