Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

ScrollRect huge performance drop

Discussion in '2017.3 Beta' started by mzouaoua, Oct 2, 2017.

  1. mzouaoua

    mzouaoua

    Joined:
    Sep 7, 2017
    Posts:
    8
    Using the same project on 2017.1.1 and 2017.3.0b2, I have a huge performance drop from ~300 fps to 10 fps on windows PC platform in the editor.
    I have two scroll rect in one canvas (Set to screen space, pixel perfect does not change anything). When disabling them, performance is back to normal.
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,590
    Seems like you found a regression in Unity. I guess Unity Technologies would be thankful if you submit a bug-report following the advice in this document.

    Using the bug-reporter seems to be an important step, because it makes sure the report is in Unity Technologies bug-tracking pipeline and has to be processed at some point. Using the forum is often used to add to a little more attention to a bug-report, but does not replace submitting the bug-report.

    It's from advantage to attach a project to the bug-report that UT can use to reproduce the issue and test their fix against. The easier an issue can be reproduced by QA, the more likely it is to get forwarded to a developer, who might or might not work on a bug-fix for that at some point.

    After you submitted the bug-report, you receive a confirmation email with a Case number. UT often asks us to post the Case number in the forum thread, which allows them to find that bug-report if they look at your post.

    Following these steps will increase the chance that UT is looking at your issue tremendously.
     
  3. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    900
    Where does the profiler say all of the time is going?
     
  4. mzouaoua

    mzouaoua

    Joined:
    Sep 7, 2017
    Posts:
    8
    It's all in canvas.sendwillrendercanvases() if I recall.
    I'm not at the office right now, I'll do a screenshot tomorow.
     
  5. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    900
    Do it with deep profiling enabled because that call covers a *lot* of potential hotspots.
     
  6. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,132
    Could you please submit a bug report with a minimal reproduction case and reply in here with the case #?
     
  7. mzouaoua

    mzouaoua

    Joined:
    Sep 7, 2017
    Posts:
    8
    I'm currently trying to reproduce the problem with a minimal scene but it doesn't seem so obvious as just putting a scrollrect in a canvas so I will keep working on this later on this weekend.

    Meanwhile, here is the corresponding profiling session :

    V2017.3.0b2
    - LayoutRebuilder.Rebuild() and Graphic.Rebuild() seems to consume everything:
    upload_2017-10-4_18-35-12.png

    - Can’t seem to find anything in LayoutRebuilder.Rebuild():
    upload_2017-10-4_18-35-44.png

    - Graphic.Rebuild() seems to have way to big of a List:
    upload_2017-10-4_18-36-3.png


    In V2017.1.1f1, Layout is not calling any of those methods:
    upload_2017-10-4_18-36-33.png
     
  8. mzouaoua

    mzouaoua

    Joined:
    Sep 7, 2017
    Posts:
    8
    Still the same issue with the V2017.3.0b3 :(
     
  9. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,132
    Still not able to reproduce it consistently?
     
  10. mzouaoua

    mzouaoua

    Joined:
    Sep 7, 2017
    Posts:
    8
    Actually yes, I have a small project to reproduce the issue. The problem is it uses a paid Treeview asset and I'm not sure whether the issue is unity only or asset related.
    Anyway, a production-ready project on 2017.1 should also work on 2017.3, I guess.

    Does anyone know if I can post a project with paid asset within?
     
  11. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,132
    Please use the bug reporter to file a bug and attach your project to it. Don't post it here.
     
  12. DrabanL

    DrabanL

    Joined:
    Nov 13, 2014
    Posts:
    40
    try disabling/removing "Content Size Fitter" component from the default "Content" object under the "Viewport" object (just to see if it resolves the fps drop - for me it did the trick)

    i have the same problem with (almost) any object having "Content Size Fitter" component regardless of being part of ScrollRect or not.
     
  13. mzouaoua

    mzouaoua

    Joined:
    Sep 7, 2017
    Posts:
    8
    That's actually doing the trick for FPS!
    The problem now is that the treeview asset I'm using is loosing scrollbars so it becomes unusable :(
     
  14. mzouaoua

    mzouaoua

    Joined:
    Sep 7, 2017
    Posts:
    8
  15. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
  16. mzouaoua

    mzouaoua

    Joined:
    Sep 7, 2017
    Posts:
    8
    It is actually fixed in 2017.3.0b5 !!!
     
    Prodigga likes this.
  17. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    Nice find. Will try it out tomorrow