AdvancedDataGrid:优化添加到底层dataProvider
朋友们,
我知道 ADG 相关问题通常会被忽略,因为“这是一个蹩脚的组件”。事实上,它不是我最喜欢的代码之一,但我坚持使用它,并且一直在(相当努力地)优化其性能。事实证明,我们可以做很多事情来让事情进展得更快。不过,我一直坚持的一件事是不要优化向底层数据提供程序添加元素。假设您想使用 DP 上的 addChildAt 调用向 ADG 添加一行。一切看起来都很好,但手术速度太慢了——令人难以忍受。现在,我意识到 ADG 可能需要重新绘制添加的线以下的所有内容,但认真地说,在 2011 年,这不应该占用大量时间和 100 美元的 CPU。有谁知道罪魁祸首可能是什么?
注意:我能够捕获“add”类型的 CollectionEvent 并且不会将它们传递给 ADG,我认为这可以解决问题,但 ADG 仍然会更新并且需要永远这样做,所以我猜测有一些东西别的地方。
感谢您的任何提示!
f
friends,
I know ADG related questions generally get ignored because "it's a crappy component". Indeed, it is not one of my favorite pieces of code ever, but I'm stuck with it and have been working (pretty hard) at optimizing its performance. Turns out there's a fair amount of stuff one can do to make things go fast. One thing I've been stuck on, though, is not to optimize adding an element to the underlying dataprovider. Say you want to add a row to the ADG using a addChildAt call on the DP. All seems well but the operation is so slow - it's unbearable. Now, I realize that the ADG may need to redraw all the stuff below the line added, but seriously, in 2011 that should not take a load of time and 100$ of my CPU. Does anyone know what may be the main culprit?
Note: I'm able to catch the CollectionEvent of kind "add" and not deliver them to the ADG, which I thought would do the trick, but the ADG still updates and takes forever to do so, so I'm guessing there's something else somewhere else.
thanks for any tips!
f
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ADG是罪魁祸首。放弃所有希望,使用 AdvandedDataGrid 的人...您检查过它的源代码吗?它在很多层面上都是残暴的......即使你找到了罪魁祸首并提出了修复方案,几乎所有真正的方法和属性都被标记为最终和私有的,因此你根本无法覆盖它的行为类型。
这是一个蹩脚的答案,但我仍然支持它......
ADG is the main culprit. Abandon all hope, ye who use the AdvandedDataGrid... Have you checked through it's source code? It's atrocious on sooo many levels.... Even if you find the culprit and come up with a fix, almost all real methods and properties are marked final and private, so that you simply can't override it's type of behavior.
It's a crappy answer, but I still stand behind it...