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. Dismiss Notice

Question Profiler : What is File.Read and why is it taking so much resources ?

Discussion in 'Documentation' started by AnthoNull, Jan 4, 2023.

  1. AnthoNull

    AnthoNull

    Joined:
    Nov 23, 2017
    Posts:
    8
    I can't find a concrete explanation on what is File.Read, I guess it has something to do with loading addressables (the spikes seams to match), but I want to be sure that I don't have another problem.
    upload_2023-1-4_16-43-48.png
     
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,167
    It reads a file. It's there in the name!

    Why a file's getting loaded as a side-effect of the Animator is a different question. The only thing I can think of is if the animation file for some reason isn't in memory when you transition to a state, but that's strange. Tried deep profiling it?
     
  3. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,096
    Depending on which Unity Version you are using there could be more info in that sample (or its "AsyncReadManager" or "Loading" parent samples) that would tell you which file is being read here. To see that, click on the drop-down labeled "No Details" on the far right, and switch that to the "More Data" option or a similarly named one, then select the N/A samples in that view.

    This same data is lightly more easily accessible than that if you switch from Hierarchy to Timeline view and check the selection "tooltip" there if it has any details.

    Finally, newer Unity versions (2021.2+) have File Access and Asset Loading profiler modules that could give you further info.