View Issue Details

IDProjectCategoryView StatusLast Update
0000379Medieval EngineersEnhancementpublic2023-01-26 16:53
Reporterequinox Assigned Toequinox  
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
Target Version0.7.4 (unreleased)Fixed in Version0.7.4 (unreleased) 
Summary0000379: Filtering toolbar to available blocks is expensive when there are a lot of block variants
Description

The toolbar updates every single frame, and iterates through every block in every variant on the toolbar. For modded scenes where the user may have all the toolbar slots filled, and variants that contain 20+ blocks this can be very expensive.

Steps To Reproduce

Start a game with the Industrial Engineers modpack (https://steamcommunity.com/workshop/filedetails/?id=2297033591) and fill every toolbar slot with high variant count entries.

TagsPerformance

Activities

equinox

2022-08-17 00:16

administrator   #~0000317

  32.9%   ClientUpdate  •  9,402 ms  •  Sandbox.Game.Screens.Helpers.MyToolbar.ClientUpdate()
    16.3%   Update  •  4,665 ms  •  edieval.GUI.Toolbar.MyToolbarItemBlockVariants.Update(MyToolbar)
      16.3%   UpdateAvailableBlockDefinitions  •  4,665 ms  •  edieval.GUI.Toolbar.MyToolbarItemBlockVariants.UpdateAvailableBlockDefinitions()
      ► 12.3%   BlockAvailable  •  3,519 ms  •  edieval.GUI.Toolbar.MyToolbarItemBlockVariants.BlockAvailable(MyBlockDefinition)
        2.67%   Contains  •  763 ms  •  System.Collections.Generic.List`1.Contains(T)
    15.0%   Update  •  4,292 ms  •  Sandbox.Game.Screens.Helpers.MyToolbarItemHandItem.Update(MyToolbar)
      13.8%   Update  •  3,957 ms  •  Sandbox.Game.Screens.Helpers.MyToolbarItemInventoryItem.Update(MyToolbar)
      ► 13.4%   GetItemAmount  •  3,843 ms  •  Sandbox.Game.MyInventory.GetItemAmount(MyDefinitionId)
      ► 0.36%   GetInventory  •  102 ms  •  Sandbox.Game.Entities.MyEntityExtensions.GetInventory(MyEntity, Int32)
    ► 0.75%   TryGet  •  215 ms  •  VRage.Game.Components.MyEntityComponentContainer.TryGet(out TComp)
    ► 0.34%   get_LocalCharacter  •  98 ms  •  Sandbox.Game.World.MySession.get_LocalCharacter()
    ► 0.02%   get_ControlledEntity  •  7.0 ms  •  Sandbox.Game.Players.MyPlayer.get_ControlledEntity()
  ► 1.32%   Update  •  377 ms  •  Medieval.GUI.Toolbar.MyToolbarItemCubeBlock.Update(MyToolbar)

#stacktrace

Issue History

Date Modified Username Field Change
2022-08-17 00:14 equinox New Issue
2022-08-17 00:14 equinox Tag Attached: Performance
2022-08-17 00:16 equinox Note Added: 0000317
2022-12-09 23:37 equinox Assigned To => equinox
2022-12-09 23:37 equinox Status new => in progress
2023-01-26 16:53 equinox Status in progress => resolved
2023-01-26 16:53 equinox Resolution open => fixed
2023-01-26 16:53 equinox Fixed in Version => 0.7.4 (unreleased)