为什么DART会使我的网站SOOOOO缓慢? [英] Why does DART make my site SOOOOO slow?

查看:175
本文介绍了为什么DART会使我的网站SOOOOO缓慢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

collegues!

collegues!

我一直在这个网站(www.2winbet.gr)工作。

I have been working in this website ( www.2winbet.gr ).

本周从网站添加了一个登录界面,该界面在 Dart 中使用聚合物作为小插件构建。

This week added a login interface from the website that was build as a small plugin in Dart using polymer.

所有工作,我很高兴与速度我管理在Dart ...构建此组件...但是,我的网站变得HYPER慢,我添加它!

It all "works", and I am pretty happy with the speed I managed to build this component in Dart... BUT.... the site became HYPER slow after I added it!!...

如果我删除它,网站再次超快...

If I remove it, the site is super fast again...

我的飞镖代码是这样的小和简单...我真的不明白问题在哪里...

My dart code is so small and simple... I can really not understand where the issue is...

你能请我指出我在这里做错了什么吗?我不能相信这是最好的Dart可以做的,当作为一个小组件添加到一个有一些动画的Wordpress网站。

Could you please point me out what have I done wrong here? I can not believe this is the best Dart can do when added as a small component to a Wordpress site that has a few animations on it.

感谢在前进

推荐答案

我问John Messerly(谁在Dart的聚合物上工作):

I have asked John Messerly (who is working on Dart's Polymer):

这看起来像是Polymer的错。聚合依赖于影子DOM,但是似乎没有很好的方式polyfill那个功能,没有包裹DOM中的每个节点。

This looks like it's Polymer's fault. Polymer depends on shadow DOM, but there seems to be no good way polyfill that functionality, without wrapping every node in the DOM.

polyfill应该尽可能快可以得到,但是,由于包装,有一些不可避免的成本。实际开销取决于DOM的大小和DOM操作与其他应用程序代码的比率。可能有一些特别慢的地区,还没有被击中,虽然。特别是事件分派似乎很难实现。

The polyfill should be as fast as it possibly can get, but, due to the wrapping, there is some unavoidable cost. The actual overhead depends on the size of DOM and ratio of DOM operations to other app code. Possibly there are some particularly slow areas that haven't been hit yet, though. Especially event dispatch seems to be tricky to implement.

获取更多数据可能会很有趣。 (随意在错误跟踪器上与我们联系)。

It would probably be interesting to get more data. (Feel free to reach out to us on the bug-tracker).

您可能在本机实现上获得最佳性能。 Chrome 35正在发货。 Firefox正在尝试一个实现。

You would probably get the optimal performance on a native implementation. Chrome 35 is shipping it. Firefox is experimenting with an implementation.

您还可以尝试重构您的应用程序,以使shadow DOM / Polymer.dart部分包含在iFrame中。这样就不会影响网页上的其他内容。

You could also try to refactor your app so that the shadow DOM/Polymer.dart part is contained in an iFrame. This way it wouldn't affect other things on the page.

这篇关于为什么DART会使我的网站SOOOOO缓慢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆