-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
可否提供使用原生 setData 和 westore 的性能比较数据? #40
Comments
对于从无到有的数据,update的方法其实慢于setData,不精确的测试的结果是大概170ms vs 200ms这样。 |
对于已有的数据呢,因为update每次都需要遍历的diff一遍,然后还需要判断是否当前页面的数据而决定给多少个页面setData。 我这边关心的是diff是否真正有用,因为setData是黑盒,所以假如内部是在jscore的上层就构建virtualDom来diff,来判断哪些传给native层通知webview线程渲染的话,diff后最小颗粒度的setData可能并没有意义 |
我的理解跟你差不多 @WebGuHui |
update + diff 可以随意操作数据,并且保证小白随意 update 也写不出慢的程序。westore proxy 版本是最终形态,diff都没有,更改数据直接可以拿到 path。 |
稍微研究过小程序在开发工具的appserver代码,setData 是每次操作后把数据放到一个队列的,之后再统一合并,并不会每次 setData 都 render 一次,这个有点类似 react.js 的 setState,所以分开写多个 setData 和一次性 setdata 理论上应该不差多少~~~ 只是技术探讨,希望能在项目中尽快集成这么好的东西~~~ |
setData 还是可以写成同步的,利用regeneratorRuntime可以这样写:
|
可否提供使用原生 setData 和 westore 的性能比较数据?这样比较直观理解westore 的性能优异
The text was updated successfully, but these errors were encountered: