Closed Sleitnick closed 4 years ago
I don't see a downside to this. This would be extremely beneficial to reducing load times in Aero-dependent games.
Perhaps Aero should run __aeroOrder
ones first, then run all the rest asynchronously. This would get the bost of both worlds. Users that never use __aeroOrder
will see these reduced load-times.
I'm going to close this for now. The minor performance gain is not really worth implementing this at this time.
Currently,
Init
methods are executed synchronously to guarantee they're all completed beforeStart
methods are executed.To improve startup speed, it might be better to run all
Init
methods asynchronously and then await them as promises before moving onto theStart
methods.Because all
Init
methods are intrinsically self-isolated (by practice, they should never be talking to other modules in the framework except for declaring references), there should be no side-effects of such a change, except for the negation of the existing__aeroOrder
flag to control initialization order. It's possible that__aeroOrder
could still be respected by guaranteeing the order if explicitly set. In other words, modules with__aeroOrder
set would still act in synchronous fashion, whereas modules without the flag set would all execute at the same time together.Example: