Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
如题,之前尝试了很多diff算法的思路,只有这个算法比较合适
也就是首尾预处理+keymap
vue3/inferno的基于lis算法和其它基于lcs的算法,复杂度基本都是O(nlog2n),这个复杂度在 fre 中得不偿失
所以还是会滚到之前的算法,也就是vue2/snabbdom的算法,这个算法的复杂度仍旧是O(n)
算法本身复杂度和 vue2 差不多,比 react 更好
但!fre使用两个map,理论上可以计算移动距离,从而决定是向前还是向后移动,这是一种可能的优化
fre 差不多就到此为止了,基本上是最好的算法了,俺只希望它能够稳定下去