Skip to content
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

iSelect 加载400多条数据要 17秒,请确认! #873

Closed
maxid opened this issue May 9, 2017 · 19 comments · Fixed by #1777
Closed

iSelect 加载400多条数据要 17秒,请确认! #873

maxid opened this issue May 9, 2017 · 19 comments · Fixed by #1777

Comments

@maxid
Copy link

maxid commented May 9, 2017

iView 版本号

2.0.0

操作系统/浏览器 版本号

macOS/Chrome 56

Vue 版本号

2.2.1

能够复现问题的在线示例(bug 相关不提供在线示例将直接 close)

iview-select.html.zip

复现步骤

打开附件中html,点击加载数据按钮

问题现象,以及你期望的结果是怎样的?

iSelect 加载400多条数据要 17秒!希望尽快解决

你估计可能的原因是什么(选填)?

估计问题的起源是以下位置, updateOption
select-vue-code-snap

@maxid maxid changed the title iSelect 加载400多条数据要 17秒,请通知你们的开发团队与测试团队 iSelect 加载400多条数据要 17秒,请确认! May 9, 2017
@guiyanakuang
Copy link

你的问题和我提交 #871 应该是同一个原因,测试了一下你的demo,在 https://unpkg.com/iview@2.0.0-rc.8/dist/iview.min.js 下可以很流畅的加载,之后的版本都会卡死

@maxid
Copy link
Author

maxid commented May 9, 2017

@guiyanakuang thks

@maxid
Copy link
Author

maxid commented May 9, 2017

@guiyanakuang rc.8 的 select.vue 中没有 append, remove 两个事件的监听 ... , 已踩了很多坑了 ...

@icarusion
Copy link
Contributor

数据较多时,建议使用远程搜索,该功能已完成,会在下个版本发布。

@starding
Copy link

感觉这中间有个bug,是不是事件循环触发了什么的,之前跟过一下代码,但是没跟出来

@starding
Copy link

@icarusion 事实上,仅仅200+数据就能让Select组件渲染时长到4,5s。

「建议使用远程搜索」这种交互方式有时候会存在问题,这意味着搜索人必须知道自己搜索的内容大致是什么,假设一个新人来使用这个组件来完成一些功能,而这个新人不知道内容的大致范围的话,就很不友好了。

而完整的select列表可以起到教育作用,即使是一个新人也能很快学到选项的大致内容范围。

@melon
Copy link

melon commented May 10, 2017

遇到类似的问题,Select组件性能问题比较严重,希望能优化一下~

@guiyanakuang
Copy link

@starding 消耗的时间随着数据量呈平方级增长,不得不猜测中间进行了两层节点循环,感觉上是有空间优化的

@guiyanakuang
Copy link

@icarusion 刚看了一遍Select.vue的源码,发现性能不佳的主要原因应该是findChild使用顺序查找option component,我想如果再维护一个optionInstancesMap对象(key:name, => value:option)保存映射,那么O(n)的查找时间复杂度可以降低到O(1),一点愚见

@tylerchen
Copy link

tylerchen commented May 12, 2017

Table组件也同样有这个问题,1.0的版本也同样存在,项目刚好进行了一半~~~~

@t7er
Copy link

t7er commented May 15, 2017

@icarusion 远程搜索怎么选定后显示成value值了而不是label值呢?

@icarusion
Copy link
Contributor

@t7er #915

@lifeforfun
Copy link

lifeforfun commented Jun 17, 2017

建议Select组件加一个 list属性接收option列表代替Option组件循环初始化,这样能节省很大一部分资源占用,另外tabs组件的样式 .ivu-tabs 建议在使用:animated="false"的时候不加overflow:hidden样式,我这里的出现的问题是此样式将内容里的Select的下拉菜单组件超出隐藏了

@xjx79
Copy link

xjx79 commented Aug 17, 2017

这个问题现在有人在解决吗?新版本里面

@xjx79
Copy link

xjx79 commented Aug 17, 2017

我现在要展示大概3000多个内容,一下子chrome就卡死了。

@haveam
Copy link

haveam commented Aug 20, 2017

这个问题确实严重,几百条就能很卡。有路由的情况下 切换必卡。

@icarusion
Copy link
Contributor

在这盖1000楼也解决不了问题,不如看看源码,提出点建设性意见来:)

@icarusion
Copy link
Contributor

不想在为这种问题烦恼了,一个个负能量满满的问题已经把我搞的心情很差,根本没心情去 fixed。
我希望大家能够善待 GitHub,善待开源。
希望大家能好好学学国外的开发者吧,来看看这个 pr 的质量和态度:
#1580

问题有很多,但需要人,需要时间,一个一个来解决,所以请理解一下吧。

@iview iview locked and limited conversation to collaborators Aug 21, 2017
@icarusion
Copy link
Contributor

不想再继续浪费 405 人的时间来接受这些负能量,所以请 @Alan110 兄台,放弃使用 iView,强烈建议你自己开发一套组件库来用,为了社区,拜托了。

@iview iview deleted a comment from Alan110 Aug 21, 2017
@iview iview deleted a comment from Alan110 Aug 21, 2017
@iview iview unlocked this conversation Sep 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants