From old Trac ticket:
When a state is modified all subscribers to that state are "kicked" regardless of whether or not they wanted that state change.
For example, if an app does SubscribeEntity with includeUpdates = false it will still be kicked (ie a context switch is made) for every update to every subscribed instance.
This is potentially very wasteful, and the check for whether a subscriber wants the state change should be added before the kick.
Comment 1:
Maybe we should also differentiate between normal subscriptions and injection subscriptions (used to kick a local owner when data has been injected). Today, for types with the injectable property, we kick any normal subscriber (as well as the local owner) when data is injected. Also the local owner will kick itself when it does a normal Set/Delete? or when it accepts/deletes an injection.
Comment 2:
There is more to this story. When an app registers an injection handler for a non-injectable type (this is ok to do) we add an injection subscription even though this isn't necessary. The result is that the handler app will always kick itself when performing a set for the non-injectable type.
Remember that the injection handler must get OnInitialInjectionsDone even though no injection subscription is inserted.
At the very least we should add a counter in dose_dll to see how many superfluous kicks we got. I.e. count the number of calls to Dispatch that did not actually do anything.