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);
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.