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

Question What is EarlyUpdate.ClearLines ?

Discussion in 'Editor & General Support' started by YunYuN1, Sep 2, 2023.

  1. YunYuN1

    YunYuN1

    Joined:
    Jan 2, 2022
    Posts:
    6
    Hello friends !

    I was trying to increase the performance of my game. When I profiled the game I found a call named " EarlyUpdate.ClearLines" that causes 11 ms lag and destroys the performance. What is it? Of course I googled it and couldn't find anything useful so don't remind me "Just Google it ". Thank you for your support
    upload_2023-9-2_22-58-38.png
     

    Attached Files:

  2. YunYuN1

    YunYuN1

    Joined:
    Jan 2, 2022
    Posts:
    6
    any ideas ?
     
  3. YunYuN1

    YunYuN1

    Joined:
    Jan 2, 2022
    Posts:
    6
    day 2 Any ideas ?
     
  4. alexeyzakharov

    alexeyzakharov

    Unity Technologies

    Joined:
    Jul 2, 2014
    Posts:
    507
    Good question! Looking into the code it does clean up of Debug.DrawLine operations.
    More likely there are quite a few operations which need to be iterated. Sorry it is not clear in the Profiler.
     
    YunYuN1 likes this.
  5. YunYuN1

    YunYuN1

    Joined:
    Jan 2, 2022
    Posts:
    6
    Thanks a lot! My performance is great now. But I really wonder why this call is in player loop ? I think it will be more clear if unity calls it in the editor loop. And do debug calls affect release builds? ( because it's in player loop ?)
     
    alexeyzakharov likes this.
  6. alexeyzakharov

    alexeyzakharov

    Unity Technologies

    Joined:
    Jul 2, 2014
    Posts:
    507
    Debug.DrawLine is only doing work in the Editor, it does nothing in both release and development players.

    Good point! As I understand it is called from Player Loop as it has a logic which is attached to the timestamp and should be executed in sync with a Player Loop. Perhaps we could mark it as EditorOnly sample to simplify understanding