Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Feedback Please make profiler easier to use on high core count CPUs while using the job system

Discussion in 'C# Job System' started by rz_0lento, Feb 26, 2020.

  1. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    I know I can limit the total worker count with JobsUtility.JobWorkerCount but it doesn't fix the usablity issue current profiler's timeline view.

    I get 23 workers listed on profiler on my 3900x (24 hw thread cpu) regardless how many workers I set to that JobWorkerCount. So if I limit the worker count to say, 3 workers, they can get randomly assigned to any of these 23 workers on the profiler view. This means that I often have to scroll down to find them and lose the valuable info on further up as these things simply don't fit into same view anymore. And if I don't limit the workers, things get spread around so badly it's like trying to find a needle on a haystack on this setup.

    So I'd like to request few things that could help here:
    - Let us search for jobs directly on timeline view by name (if this is somehow doable already, please tell me)
    - Possibly hide worker threads on profiler that are inactive
    - Allow us to permanently limit the editor's worker count via commandline argument etc so that job system would never list more than max amount of worker threads we define on those parameters.

    These screenshots should help visualizing the issue:

    3900x without capping the JobWorkerCount:


    3900x with JobWorkerCount capped to 3:


    When I still used job system on my old 4 hw thread i5 cpu, profiler was still pretty usable as all the info I needed fit into screen properly.
     
  2. alexeyzakharov

    alexeyzakharov

    Unity Technologies

    Joined:
    Jul 2, 2014
    Posts:
    507
    Thank you for the feedback!
    We have a similar request on a backlog - I've added yours as well
    Great idea added to the backlog.
    I'm pretty sure there is
    -job-worker-count <N>
    cmdline support since 2019.3 (not sure if it is supported in the Editor).

    I'll check out if we actually shut down job threads, so that we can reset threads layout e.g. on Clear or new capture. Overwise option #2 would be a reasonable addition to profiler preferences.
     
  3. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Thanks for the reply :) I just tried this with the editor and it does work. If I launch the editor with this, the profiler only lists the amount of worker threads set on the command line! This will be really nice workaround for the time being :)

    If any user reads this, you can also add these parameters per project on Unity Hub. Just click on the three vertical dots on right edge of your project on the list and in Advanced Project Settings add:
    -job-worker-count 3
    or whatever worker count you want to that textbox there. This way every time you launch the project via hub, you'll get the limited workers in the profiler view as well.

    This is way better now :)