Search Unity

(Case 940666) Physics2D significant performance cost (even when no Physics2D features are used)

Discussion in '2017.2 Beta' started by Peter77, Aug 9, 2017.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,088
    The Profiler in Unity 2017.2.0b6 shows a significant cost for "Physics2D", even when no Physics2D features are used. This issue occurs in a build and editor. This issue does not seem to exist in Unity 2017.1.0p1.

    I noticed this in my actual project, where I don't use any Physics2D features, but Physics2D often peaked to more than 2ms in the Profiler. I was able to reproduce this issue in a simple project by just rotating a few Rigidbodies.


    Reproduce
    • Open user project
    • Open Assets/Scene.unity
    • Open Window/Profiler
    • Enter "Physics2D" in Profiler search field
    • Press Play
    Observe Physics2D comes with a significant cost. The provided example spends about 1ms in Physics2D. The cost is directly related to the number of Rigidbodies.


    Expected
    Physics2D costs 0 ms, if no Physics2D features are used.
     
    laurentlavigne and LeonhardP like this.
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,088
  3. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Again Excellent bug report and find Peter good work...
    Performance seems be real struggle with Unity testers
     
    Peter77 likes this.
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    8,399
    I think simply adding rigidbodies (even if they are kinematic) activates physics2D to do stuff.

    That's definitely been the case for 3d physics for a while at least.
     
  5. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,372
    @Peter77 get ready to receive many unity beta tshirts ;)
    (I didn't know we had search field in the profiler)
     
    Peter77 likes this.
  6. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,088
    With a text saying "I spent hundreds of hours reporting Unity bugs and all I got was this lousy T-shirt"?! :rolleyes:
     
  7. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,372
    Yup, that's how they roll now.
    A few releases back you would have gotten $100 in asset store credit. I did and used it all, it was useful.
    A few weeks back I received an email thanking me for my contribution in the beta, offering me 2 beta tshirts. Since the design is meh and I am not one to wear brands, I played a prank on a friend. He hates Unity with a passion, I had unity send those tshirts to him :D
    In XXL
     
  8. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,088
    I actually think it's a nice gesture and I appreciate that. However, I did spend so much time submitting high-quality bugs reports over the last years, that I believe a life-time Unity license should be the least what Unity Technologies should offer me. :eek:
     
    Last edited: Aug 16, 2017
  9. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,372
    I think they will do that eventually, when they realize that the cost of sifting through crappy bug reports is more than the "non gain" of giving a year of pro license to ace bug reporters.
    Right now, we let them enjoying free community labor.
     
unityunity