ce900063c0
The idea of optimization is simple – delay in-block modification until the end of a write action. Q: Why the end of write action? A: We have to publish the result of modification somewhere during write action to be sure that the next read action will see the updated result. We can't publish the result somewhere later because we can't guarantee that the modification will be visible to all customers. In the case of out-of-block modification, we still have to publish the result immediately because it is hard to evaluate the consequences of the opposite decision yet. If an out-of-block modification happens, we can drop all previous in-block modifications from the queue because they don't make sense due to invalidation of the entire KtModule. A corner case is the analysis under write action. The delay means that there is no longer any guarantee that all PSI changes will be reflected into FIR tree immediately. So now we can guaranty only that at the start of `analyze` block you will have the up-to-date FIR tree. ^KT-60611 Fixed