Closed winzou closed 10 years ago
Hi,
Is the callback instantiation overhead so important ? Even with the lazy instantiation ? There is only a proxy instantiated, no ?
The lazy option just avoids the loading of every loaders when you instantiate your state machine factory.
TThis PR avoids the loading of every callbacks when you instantiate your state machine.
And yes, loading all callbacks just to call a can
, it's not good pattern.
To have callbacks instantiated only when they are to be called.
The approach I had with the CompilerPass before was not wrong, but it had the disadvantage of instantiate all callbacks when the Loader was loaded. This PR avoid this, and makes the callbacks instantiated only when a transition is applied and the callback is to be called.