Search Unity

Huge spike caused by TextureStreamingManager

Discussion in 'Editor & General Support' started by BitAssembler, Mar 24, 2020.

  1. BitAssembler

    BitAssembler

    Joined:
    Jul 13, 2017
    Posts:
    90
    We are experiencing huge CPU spikes (150 - 250 ms) when texture streaming is enabled. This makes navigation in a level almost impossible while being in the editor. Is this a known issue? The lag origin seems to be located in the TextureStreamingManager.Update() method.

    upload_2020-3-24_21-45-35.png

    Any help on this issue is appreciated.
     
  2. alexeyzakharov

    alexeyzakharov

    Joined:
    Jul 2, 2014
    Posts:
    507
    What exactly takes so much time if you drill down into TextureStreamingManager.Update()?
    Perhaps tuning Texture Streaming budgets might help.
     
  3. BitAssembler

    BitAssembler

    Joined:
    Jul 13, 2017
    Posts:
    90
    Thanks for getting back to me. It's TextureStreamingManager.LoadMipLevels() to causes the spikes.

    Lowering the texture budget to 512 MB solves the issue, but gives bad results. Maybe we disable the texture streaming in the editor for now and see how this performs in the build.
     
    alexeyzakharov likes this.
  4. lyndon_unity

    lyndon_unity

    Unity Technologies

    Joined:
    Nov 2, 2017
    Posts:
    66
    In editor the textures are a blocking load rather than an asynchronous load.
    This should be much smooth at runtime where the texture loading is properly asynchronous.

    Textures loaded from asset bundles can utilise the async loading even in editor.
    So utilising asset bundles should remove this hitch.

    Another option is to reduce the QualitySettings.streamingMipmapsMaxLevelReduction in the quality settings you are using when viewing in the editor so it doesn't load the largest mips (which are slowest to create/load and will give the largest stall).