Search Unity

Performance drop with minimal CPU/GPU usage

Discussion in 'Editor & General Support' started by SurrealRien, Dec 17, 2020.

  1. SurrealRien

    SurrealRien

    Joined:
    Jul 27, 2020
    Posts:
    1
    Hi all
    This is likely due to me not understanding Unity at all, but I found something that is puzzling me.
    I was messing around with procedural generation of 2D Quads and assigning them each a noise value and decided it would be fun to see just how many my computer can handle (Ryzen 1700/GTX 1080).
    Before anyone mentions it - yes, I'm well aware this isn't efficient in the slightest and there are many significantly better ways of doing this, this was just out of curiosity.

    So this screenshot is Unity rendering 90,000 quads and, well, the frame rate took a pretty sizable hit, which is to be expected.

    upload_2020-12-17_11-35-38.png upload_2020-12-17_11-38-23.png

    The problem I have is: Why is it taking a hit? I would expect the camera rendering so many quads to tank the frame rate but looking at my CPU/GPU usage, my CPU is sat at 15% usage (one core is doing most of the heavy lifting but that's only sitting at around 40 - 50%) and the GPU at 6%. This holds true when I build the game and run it fullscreen where the results are basically the same.
    I'm clearly bottlenecking something, but I'm curious, what is it? What am I actually maxing out? This scene is obviously very CPU bound, but if that's the case why isn't my CPU sitting around 100% usage?

    The most likely explanation is I'm massively misunderstanding something about how Unity works, but it would be great if someone could shed some light on this for me!

    Thanks
     
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,461
    Could be that you are bottlenecked to RAM speed, i.e. your CPU could process the data faster but needs to wait on it getting loaded from RAM into L1 Cache? The unity Profiler doesn't have any info on hardware counters but you could try AMD's uProf to see those and get more details on what your hardware is doing here.