Search Unity

what do you think about my script profiler result ?

Discussion in 'Scripting' started by m-y, Feb 17, 2019.

  1. m-y

    m-y

    Joined:
    Sep 22, 2013
    Posts:
    472
    Hello all
    i am beginner in profiler
    alot of things still i don't know
    so i need your feedback step by step till i lunch my game
    that is the first stage of my game script only results
    i care for my scripts and memory result
    so please tell me is it perfect or not , Thanks ?
    upload_2019-2-17_15-2-48.png


    upload_2019-2-17_15-3-49.png
     
  2. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    825
    Well, ask yourself, do you need 10,000 fps. Nope.
    Without code for context its impossible for us to say if this is normal but by the looks of it you have almost no code anyway considering the 0.1ms time.
     
  3. m-y

    m-y

    Joined:
    Sep 22, 2013
    Posts:
    472
    no i have the code that manage my game systems , it is a strategy game
    building
    enemy movement
    weapons firing
     
  4. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    825
    Well once again, 10,000 fps is a lot. We still have no code for context so all we can do is assume its fine.
     
  5. m-y

    m-y

    Joined:
    Sep 22, 2013
    Posts:
    472
    10,000 is a lot for positive way or negative way ?
     
  6. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    825
  7. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,609
    Something doesn't seem right with the numbers. It displays 10000 frames per second, but it also displays one frame is taking 14.08 ms. This doesn't match.
     
    Ryiah likes this.
  8. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    You're not doing much in your game. Come back to the profiler when you have more of your game implemented. There isn't much to learn from it this early on other than comparing against previous runs through the profiler.
     
  9. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,451
    That's because all the heavy categories in the CPU module are disabled. The remaining ones then scale to fit the chart and the visual aid line there only says that, if it where just usercode and "others" it would be 10k fps. I'm guessing Rendering and the rest will take up the remaining 13.97 ms of the frame ;)

    @Joe-Censored: I wouldn't say Profiling early, especially to learn about how your code performs is a bad thing. Quite the contrary, I advocate for using the Profiler as more than just a debugging tool once everything goes south and the release date has to be moved because the performance is bad, now that all the content is in. Some things you can always keep an eye out for is GC Allocations in your main loop. Outside of your main-menu or scene loading, I'd strive to keep that as far down to 0 (if not at 0) as possible.

    In that regard, this particular frame is fine but looking at the memory chart, there are quite some allocations there. You might want to look at this tutorial topic.

    That said, there is such a thing as over-optimizing as well as getting bothered by the wrong stats. As discussed, your script code seems to have very little impact on your performance, at least directly. If you want to gauge how you are doing with regards to your overall performance towards a potential release, you should create a performance Budget. For that:
    1. Identify the platforms you want to release on
    2. Out of those, identify the lowest hardware configuration and get your hands on it.
    3. Decide whether you want to aim for 60 of 30 fps
    you can technically skip Step 1&2 for now but you should always test your budget on the slowest target device.
    Now you have a target of either 16ms(60FPS) or 33ms(30fps) and can divide that time amongst the different systems of the engine and your game, e.g. along the lines of the profiler categories and then split underneath that to all the different parts of it that you know you want to have. Assign some eyeball values on each category or system and make sure you stay within the maximum total ms. Now you can always check that you, on average, stay within the margins you set out for yourself. If not, see if you can afford to change your budget or if you want to optimize the category in which you are falling behind.

    Keep in mind, that you can't really tell what the performance of a system will be until you know what the maximum load on that system will be. You might want to create load tests with mock assets that are ugly pixel and vertex messes but on paper (in terms of texture sizes, vertices, bones, animations, shaders) roughly equal to what you want to have in the end.

    With this, you can gauge your performance of subsystems even early on in development. It's a bit more complex than just looking at one frame in the profiler though and not something we can do for you based on nearly no input about the project.
     
    m-y and Joe-Censored like this.