Search Unity

AABBClearJob...why is it so expensive? What does it do?

Discussion in 'Graphics for ECS' started by Fribur, Nov 10, 2021.

  1. Fribur

    Fribur

    Joined:
    Jan 5, 2019
    Posts:
    136
    [Edit: Never mind, I should have profiled a build. The time was the Editor loop.]

    Trying to understand where most frame time is spend, I noticed the HybridRendererSystem spends >5ms in AABBClearJob. What does it do? What can I do to get this time down?
    upload_2021-11-9_21-29-40.png

    Edit: Issue vanished when profiling a build.
    upload_2021-11-9_21-41-10.png
     
    Last edited: Nov 10, 2021
  2. lic1227

    lic1227

    Joined:
    Jul 14, 2015
    Posts:
    41
    Same Issue,even when there is NO renderer at all
     
  3. temps

    temps

    Joined:
    Dec 7, 2011
    Posts:
    10
    This job is very heavy in the editor because safety checks are on. In our project we have disabled safety checks specifically for this job so it's fast in the editor as well.
     
  4. lic1227

    lic1227

    Joined:
    Jul 14, 2015
    Posts:
    41
    Is Safety Check On or Off affect build player performance
     
  5. apkdev

    apkdev

    Joined:
    Dec 12, 2015
    Posts:
    283
    AFAIK safety checks are always off in builds, so this only affects the editor. You can toggle the safety checks for the editor on and off in the Jobs menu.

     
  6. lic1227

    lic1227

    Joined:
    Jul 14, 2015
    Posts:
    41
    Even Off in dev build?
     
  7. temps

    temps

    Joined:
    Dec 7, 2011
    Posts:
    10
    Yes it's always off in builds.

    If you want to specifically disable safety checks for a job you can add [BurstCompile(DisableSafetyChecks = true)] above it's job struct. We do it very sparsely because they are there for a reason.