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

Camera.Renderer: file read causes a huge performance drop

Discussion in '2017.2 Beta' started by georgeq, Sep 5, 2017.

  1. georgeq

    georgeq

    Joined:
    Mar 5, 2014
    Posts:
    660
    I don't know why the Camera Renderer has to open and read a file in the middle of the game play. I don't know the internals of the engine but I understand there should be a good reason the read some data from a file during the camera rendering process, however I don't see why the file has to be open in the middle of the game play instead of at the game's start up, where's the player won't notice a few extra milliseconds.

    profiler.png

    As you see opening and reading the file in the middle of the game play causes a 141ms spike, and 109 of them are taken the the File.Open operation alone. The read operation takes 31ms, so if the file was opened at game start I would be seeing a 31ms spike instead of a 141ms.
     
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,111
    Hi georgeq,
    Could you please file a bug report with a minimal reproduction case and reply in here with the case #? It's hard to tell what's going on without more information.
     
  3. georgeq

    georgeq

    Joined:
    Mar 5, 2014
    Posts:
    660
    I working on that, but since it doesn't occur all the times is kind of hard to figure out a reproduction case... however be sure I'll file a bug reporte as soon I have a reproduction case identified.
     
    LeonhardP likes this.