Closed luozejiaqun closed 5 years ago
@luozejiaqun What are the real world performance concerns you have around creating a new thread? They don't have 0 cost but they have relatively little cost.
@luozejiaqun Also, what race conditions are you concerned about? The MvRx threading model was pretty carefully considered to avoid getting race conditions.
@gpeal My thought is very simple. Almost very View
has a ViewModel
(maybe more than one), and every ViewModel
has a StateStore
which needs a new thread to update the state. That maybe waste. Updating state is shallow copy, I don't think that will affect performance.
@luozejiaqun The less work you do on the main thread the better. You were the one who was worried about immutable list performance but this solves that problem for you.
As I mentioned in #79 .
stateReducer
is just updating the state, why can't put it in main thread. I know the performance advantages of using background threads. But using main thread and avoid creating new threads also has performance advantages.