World.Optimize(IParallelRunner,Action).md

March 19, 2022 ยท View on GitHub

DefaultEcs

DefaultEcs.World

World.Optimize(IParallelRunner, Action) Method

Sorts current instance inner storage so accessing Entity and their components from EntitySet and EntityMultiMap<TKey> always move forward in memory.
This method will return once mainAction is executed even if the optimization process has not finished.
This method is not thread safe.

public void Optimize(DefaultEcs.Threading.IParallelRunner runner, System.Action mainAction);

Parameters

runner IParallelRunner

The IParallelRunner to process this operation in parallel.

mainAction System.Action

An System.Action to execute on the main thread while the optimization is in process.