Why does an empty scene with FPS Graph lag on an iPhone 4 with iOS 7?

I’ve been trying to pinpoint the source of some jumpiness/lag i’ve noticed in my game ever since I upgraded to iOS 7. (It worked perfectly on this device prior to the upgrade, and had all the same apps installed) Ultimately i’ve set every object in a scene to inactive apart from a camera which has FPS Graph (FPS Graph - Performance Analyzer | GUI Tools | Unity Asset Store) running on it and no other scripts.

To my surprise i’ve found I still get intermittent single bar spikes where the frame rate reduces to around 10 fps.

Now naturally i’m about ready to blame this on iOS 7, but since I haven’t found any other complaints about this sort of thing i’m forced to ask, is there anything else which could be causing this? Is intermittent single bar spikes to 10 fps normal for FPS Graph? Can inactive objects in a scene or indeed other scenes somehow effect the performance of the active scene?

(Sorry for these weird questions guys. I’m just really hesitant to blame this one on iOS7, especially when a complete restore of my device has had no effect on its performance.)

i think the answer you are looking for might be this

  1. create a guitext from gameobject tab.

  2. create a c# and name it FPSCounter and attach it to the guitext you just created

  3. replace all its content with the following

    using UnityEngine;
    using System.Collections;

    /* **************************************************************************

    • CLASS: FPS COUNTER

    • ************************************************************************/
      [RequireComponent(typeof(GUIText))]
      public class FPSCounter : MonoBehaviour {
      /
      Public Variables */
      public float frequency = 0.5f;

      /* **********************************************************************

      • PROPERTIES
      • *********************************************************************/
        public int FramesPerSec { get; protected set; }

      /* **********************************************************************

      • EVENT HANDLERS
      • ********************************************************************/
        /
      • EVENT: Start
        */
        private void Start() {
        StartCoroutine(FPS());
        }

      /*

      • EVENT: FPS
        */
        private IEnumerator FPS() {
        for(;;){
        // Capture frame-per-second
        int lastFrameCount = Time.frameCount;
        float lastTime = Time.realtimeSinceStartup;
        yield return new WaitForSeconds(frequency);
        float timeSpan = Time.realtimeSinceStartup - lastTime;
        int frameCount = Time.frameCount - lastFrameCount;

         // Display it
         FramesPerSec = Mathf.RoundToInt(frameCount / timeSpan);
         gameObject.guiText.text = FramesPerSec.ToString() + " fps";
        

        }
        }
        }

as i see from that FPS you are using, i think i cannot rely on something like that because an empty scene as you are saying is not really empty, there are scripts running and also there are gui objects (an empty scene has 0 draw calls and 0 tris) the one you are using has either one or both been used.

try using the one i gave you,

Note: ios for iphone only limits to 30FPS compared to 60FPS from a Pc or Mac.

It’s probably due to the fact that ios7 is like, five minutes old, and unity has yet to release an update to accommodate its quirks.

I think I am seeing a much lower frame rate due to huge spikes on iOS7.
On an iPhone4 and 4s that were about 30Hz on iOS6, there are huge spikes after upgrading to iOS7. The iPad2 suffers from the same problem - I think its fine on iOS6 but spikes on iOS7.

I’ve not got to the bottom of it yet - but I’ll try and post up when I do. I am over-budget on draw calls and its a complex scene. All of our spikes so far have a high number of particle renderers on screen too, but for all I know this is just coincidence.