简体   繁体   English

Knockoutjs在Internet Explorer中运行速度极慢

[英]Knockoutjs operates extremely slow in Internet Explorer

In brief : I've got a page with KO-code that operates absolutely cool in Google Chrome, Firefox, Safari, etc. But the performance is gone in Internet Explorer. 简而言之 :我有一个带有KO代码的页面,在谷歌浏览器,Firefox,Safari等中运行得非常酷。但是在Internet Explorer中性能已经消失。 I tried IE10, IE11. 我试过IE10,IE11。 It takes from 10 to 25 seconds to render about 150 rows. 渲染大约150行需要10到25秒。 在此输入图像描述

Details : There page represents a work queue for users, where their tasks are shown. 详细信息 :该页面表示用户的工作队列,其中显示了他们的任务。 The requirement is not to use any paging on that page. 要求不要在该页面上使用任何分页。 Each row of the table has at least a dozen of variants to display (links, buttons, inputs, css styling, handling user events, custom js plugins, etc.). 该表的每一行至少有十几个变体要显示(链接,按钮,输入,CSS样式,处理用户事件,自定义js插件等)。 The average number of rows on prod is 100-200+. prod上的平均行数为100-200 +。 User is able to apply different filters and sortings. 用户可以应用不同的过滤器和排序。

Things I've already tried : 我已经尝试过的事情

The approaches specifed above tuned the code (according to ko.bindingReport.js ) almost two times faster in Chrome. 上面指定的方法在Chrome中调整代码(根据ko.bindingReport.js )几乎快两倍。 But IE is still too slow - about 10 seconds for rendering. 但IE仍然太慢 - 渲染大约10秒。

Chrome : Chrome Chrome状态

Internet Explorer: IE浏览器:

IE状态

Folks, any ideas? 伙计们,有什么想法吗?

"The table binding provides a fast method for displaying tables of data using Knockout. table is about ten times faster than nested foreach bindings." “表绑定提供了一种使用Knockout显示数据表的快速方法。表比嵌套的foreach绑定快十倍。”

This claims to be 10x faster. 这声称要快10倍。 https://github.com/mbest/knockout-table https://github.com/mbest/knockout-table

You reduced the amount of computed observables, but did you also reduce the amount of observables? 您减少了计算的可观察量,但是您是否也减少了可观察量? I'm not seeing a lof of editable fields. 我没有看到任何可编辑的字段。 The ones that are not being edited on the page probably don't need to be an observable? 未在页面上编辑的那些可能不需要是可观察的? This has boosted my performance quite a lot of times. 这极大地提升了我的表现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM