Search Unity

Help with confirming bug needed - Lower FPS in Unity 4.3

Discussion in 'Editor & General Support' started by Tiles, Nov 13, 2013.

  1. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,474
    As told in another thread, my FPS are visibly slower in Unity 4.3 than in Unity 4.2. In the Editor it´s around 10 fps slower when i look at my internal FPS counter. As an exe it`s about the double slower when i look at my internal FPS counter. See screenshot.

    Before i tear my project apart to submit a bug report, does somebody else encounter this problem? Has somebody else a clue what the baddie could be?

    The curious part is that my internal fps counter counts a really different value than the one in the statistics panel. Does Unity treat the fps counter script in a different way now? Means, is this maybe a problem with the FPS counter script that i use?

    The FPS Script is as follow:

    Code (csharp):
    1. // Attach this to a GUIText to make a frames/second indicator.
    2. //
    3. // It calculates frames/second over each updateInterval,
    4. // so the display does not keep changing wildly.
    5. //
    6. // It is also fairly accurate at very low FPS counts (<10).
    7. // We do this not by simply counting frames per interval, but
    8. // by accumulating FPS for each frame. This way we end up with
    9. // correct overall FPS even if the interval renders something like
    10. // 5.5 frames.
    11.  
    12. var updateInterval = 0.5;
    13.  
    14. private var accum = 0.0; // FPS accumulated over the interval
    15. private var frames = 0; // Frames drawn over the interval
    16. private var timeleft : float; // Left time for current interval
    17.  
    18. var labelfps: UILabel;
    19.  
    20. function Start()
    21. {
    22.     timeleft = updateInterval; 
    23. }
    24.  
    25. function Update()
    26. {
    27.     timeleft -= Time.deltaTime;
    28.     accum += Time.timeScale/Time.deltaTime;
    29.     ++frames;
    30.    
    31.     // Interval ended - update GUI text and start new interval
    32.     if( timeleft <= 0.0 )
    33.     {
    34.         // display two fractional digits (f2 format)
    35.         labelfps.text = "FPS  " + (accum/frames).ToString("f2");
    36.         timeleft = updateInterval;
    37.         accum = 0.0;
    38.         frames = 0;
    39.     }
    40. }
     

    Attached Files:

  2. boone188

    boone188

    Joined:
    Apr 5, 2013
    Posts:
    8
    For me the slowness seems to be caused by CreateVBO calls when rendering.
     
  3. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,928
    I experienced this too... In editor its actually faster than it was in 4.2... However, in a windows build its EXTREMELY slow(like 10 fps). Webplayer was fine.
     
  4. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,474
    Thanks folks :)

    So it`s not my fps script, but it`s really Unity 4.3 being slower, right? boone, do you encounter the same issue after upgrading your project?
     
  5. boone188

    boone188

    Joined:
    Apr 5, 2013
    Posts:
    8
    Yes only after the upgrade. I rolled back to 4.2 and I'm getting high FPS again.
     
  6. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,474
    Thanks :)

    I will extract one of my levels and make a bug report with it now.
     
  7. sh0v0r

    sh0v0r

    Joined:
    Nov 29, 2010
    Posts:
    295
    Yes 4.3 Standalone builds seem to be running much slower. %50 slower in my case.
     
  8. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,474
    Thanks for confirming :)

    Hm, but it seems that not all levels are affected in a similar way. I have extracted a level now, and curious enough, this level runs equal fast in both builds, the one that is made with 4.2 and the one that is made with 4.3

    Continuing to test with another level that definitely showed slow fps in 4.3 in my mainbuild before ...
     
  9. bigzer

    bigzer

    Joined:
    May 31, 2011
    Posts:
    159
    Hi,

    I experience also drastic performance decrease comparing the same project on 4.2.1f4 and 4.3 on a not so recent GPU (convenient to test performance);

    This is how I tested it
    $42_Occlusion_Shadows.jpg $43_Occlusion_Shadows.jpg

    Scores are
    4.2 VS 4.3
    Occlusion Culling + Real time shadows
    51FPS - 24FPS

    No Occlusion culling + Real time shadows
    57FPS - 6FPS
    I have to admit the result with on 4.2 was a surprise. I rebuild twice to see if what I was reading was correct and yes, even when I go to the other corner of the map and look towards the direction with the most objects/triangles I still had a healthy 52 FPS. I suppose this is because the map is not so complex? I have 473K triangles at that location when I don’t turn on the occlusion culling with 394 draw calls and 813 saved by batching. Anyway, weird stuff I never would have found out in 4.2 without this current 4.3 issue. Also a proof that there's something seriously wrong with the way the culling works both on 4.2 and 4.3.

    On the other side I think the shadows in 4.3 are clearely the issue here. Maybe because I use the shadow softner package. I Will delete it from the project now, rebuild and tell you how it went in this reply.


    4.2 No Occlusion culling No real time Shadows
    62FPS - 53FPS


    Hope this helps finding out new stuff
     
    Last edited: Nov 13, 2013
  10. bigzer

    bigzer

    Joined:
    May 31, 2011
    Posts:
    159
    I confirm the shadown softner package is not the cause of 6FPS when shadows are activated.

    Its a unity 4.3 issue for sure.

    Also for your information all tests where actual builds.
     
    Last edited: Nov 13, 2013
  11. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,474
    I use Unity free. So it`s definitely not a soft shadow thing.
     
  12. ...liven...

    ...liven...

    Joined:
    Dec 23, 2010
    Posts:
    36
    Facing the same visible slowness in unity 4.3 . In 4.2.2 my project was working better.

    New features but some lags here there.

    I am also the (I think) first one, to see a new bug in unity 4.3. And that is The Image Effects that are a pro only feature are working in my non-pro unity 4.3 version, up-to 4.2.2 these were not working.

    One thing everyone, nothing to surprise those are mistakenly working in Editor only. But on production builds, its still locked, which is true for a non-pro user.

    Hope unity should fix this, soon in Unity 4.3.1 or something ....

    Anyways, what so ever, UNITY is and will always be a great tool
     
  13. Joe-Robins

    Joe-Robins

    Unity Technologies

    Joined:
    Apr 21, 2008
    Posts:
    430
    Hey all, a bug on this issue has been logged in our system so we are aware of the bug and its being looked into.

    Cheers
     
  14. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,021
    Thanks Joe!
     
  15. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,474
    This is good news. Good luck with catching it :)
     
  16. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,118
    waiting for 4.3.1 to upgrade then ;)
     
  17. bigzer

    bigzer

    Joined:
    May 31, 2011
    Posts:
    159
    Great, I'm sweating pingpong balls here, we're getting ready to send demos and I could certainely use some of those optimisations, as long as they actually optimise things ^^.

    Could it be that Unity rushed the release? Probably :).
    But why exactly?
    South Korea anual G-star conference of course :D (its like the GDC of asia if you don't know, its quite big and yes unity has a booth there and all the asian staff as well as probably David and co)
    Now everything makes sense doesn't it?
    Bad Unity baaad!
     
  18. testure

    testure

    Joined:
    Jul 3, 2011
    Posts:
    81
    And here is where people learn why studios don't update to the latest version of an engine for critical projects :)
     
  19. Calaek

    Calaek

    Joined:
    Feb 19, 2013
    Posts:
    15
    That's not a valid statement. A lot of studios upgrade to the latest engine if there is a feature that is important to them. Take us for instance, the nav mesh carving feature for obstacles was a life saver.
     
  20. winterkewl

    winterkewl

    Joined:
    Oct 28, 2011
    Posts:
    53
    We've been waiting on a bug fix in 4.3 for quite a while, so upgrading for us was almost mandatory. So we are really hoping the Unity Devs can find a work around for this slow down bug as well. The good news is I have every faith in them addressing this one as it seems like it's a known issue now.
     
  21. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,562
    Just look at the history of Duke Nukem Forever... and then when they finally finished the game it was complete and utter garbage.
     
  22. bigzer

    bigzer

    Joined:
    May 31, 2011
    Posts:
    159
    Same here, we just happend to be working on the animation controller and the new event triggering is just pure gold, doing it the old way is just too hacky compaired to this.
     
  23. testure

    testure

    Joined:
    Jul 3, 2011
    Posts:
    81
    and what are you guys going to do when 4.3.1 or whatever has a bug? wait for 4.3.2? Eventually you need to ship your game :)
     
  24. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,819
    Revert to 4.2 for the time being. Hope it gets fixed soon, because there's a ton of awesome stuff I want to use!
     
  25. bigzer

    bigzer

    Joined:
    May 31, 2011
    Posts:
    159
  26. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    719
    Waiting till bug fix
     
  27. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    7,300
  28. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    416
    Does anybody know if this affects iOS Builds?

    Thanks.
     
  29. Kirill-G

    Kirill-G

    Joined:
    Oct 5, 2012
    Posts:
    1
    Same problem! Unity 4.3 is twice slower.
     
  30. homerender

    homerender

    Joined:
    Sep 14, 2012
    Posts:
    182
    +1( Build is too slow(
     
  31. Helkus

    Helkus

    Joined:
    Dec 20, 2012
    Posts:
    7
    I can confirm this issue. We recently put out a patch to our live users and our forums blew up with performance complaints so we had to roll back to unity 4.2.2. Most people said they had lost about half their framerate in windows standalone. Lets hope we get a fix soon!
     
  32. JamieFristrom

    JamieFristrom

    Joined:
    Nov 2, 2012
    Posts:
    20
    Hey Joe, I seem to be seeing the bug too - runs ~15fps in editor and a slideshow as a standalone windows build. My project's enormous so it doesn't make sense for me to upload, but I could give you access to my SVN server if you promise not to laugh at my code. E-mail me if you're interested - jdfristrom@gmail.com
     
  33. bigzer

    bigzer

    Joined:
    May 31, 2011
    Posts:
    159
    It's confirmed, this issue has been resolved and will be one of the fixes you'll find in 4.3.1 soon.
     
  34. Goss

    Goss

    Joined:
    Dec 6, 2012
    Posts:
    11
    Is soon like within the next few days or couple weeks?
     
  35. Alabatross

    Alabatross

    Joined:
    Dec 15, 2012
    Posts:
    223
    Last edited: Nov 27, 2013
  36. bigzer

    bigzer

    Joined:
    May 31, 2011
    Posts:
    159
    I think within 7 days unless something big is discovered with RC1
     
  37. Marek Baczynski

    Marek Baczynski

    Joined:
    Jul 23, 2013
    Posts:
    1
    It seems that the same issue is on the Mac build of Unity. Noticed it just now, 2 weeks after updating. What's interesting though is that the little "stats" gizmo in the game view still reports 130+ fps, while the game is running at approx. 30, with regular dips to as little as 15fps - very visible when waling around.

    I've run the profiler, and it in turn reports that the GPU is taking <4ms (250+ fps), and CPU is under 10ms (100+ fps), with the most time-consuming task being, *drumroll* "WaitForTargetFPS" at ~60-70% time. Im certain there is no target fps set in the game just yet!

    Hope my observations helped, keep up the good work, unity team!
     
  38. bluescrn

    bluescrn

    Joined:
    Feb 25, 2013
    Posts:
    503
    Don't have any precise measurements, but running in the editor, 4.3 seemed slower. But the editor framerate also seems very variable, and can change rather a lot between different runs of the same scene.

    But really, editor framerates don't matter too much. I'm more concerned about the new occlusion culling system, and whether it's really a viable option on mobile. The old PVS system gave us a noticable framerate boost, but the new system is worrying, as it sounds rather complicated/high-end (and potentialy expensive at runtime), and not something that I'd have really considered even attempting on mobile platforms...
     
  39. niflying

    niflying

    Joined:
    Jul 11, 2012
    Posts:
    53
    v4.3.1 has this issue too.

    There are 96 sprites without animation. And bulid for IOS.

    Use unity4.3.1 the FPS is 47
    $g1.png

    use 4.1.2 the FPS is 57

    $g1.png


    the FPS lost almost 10.



    my projec
    View attachment $test.zip

    I use this shader

    Shader "Custom/Transparent Coloredv"
    {
    Properties
    {
    _MainTex ("Base (RGB), Alpha (A)", 2D) = "white" {}
    }




    SubShader
    {
    LOD 100

    Tags
    {
    "Queue"="AlphaTest"
    "IgnoreProjector" = "True"
    "RenderType" = "Transparent"
    }

    Pass
    {
    Cull Off
    Lighting Off
    ZWrite On


    Fog { Mode Off }
    Offset 1, -1
    ColorMask RGB
    AlphaTest Greater 0.4
    ColorMaterial AmbientAndDiffuse

    SetTexture [_MainTex]
    {
    Combine Texture * Primary
    }
    }

    }
    }
     
  40. SketchWork

    SketchWork

    Joined:
    Jul 6, 2012
    Posts:
    214
    Yes, 4.3.1 is still having the same issues. Our games are still running very much slower than they did in 4.2.
     
  41. rextr09

    rextr09

    Joined:
    Dec 22, 2011
    Posts:
    416
  42. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Why are you cross posting?

    I'll answer in your thread...
     
unityunity