什么情况下 Javascript 性能在 IE8 中会比 IE7 差?

发布于 2024-09-30 04:58:39 字数 620 浏览 0 评论 0原文

我在一家使用 Javascript 构建交互式座位表的公司工作。这是一个示例: http: //seatgeek.com/event/show/457624/miami-dolphins-at-new-york-jets-2010-12-12/。它们在很多方面模仿谷歌地图的功能。

我们正在处理一个奇怪的问题——地图的性能在除 IE8 之外的所有浏览器中都很好。我将 IE6 和 IE7 包含在“所有浏览器”类别中。我们发现 IE8 中的 JS 性能明显较差。当您尝试在 IE8 中拖动地图时,它会有点锁定并且有明显的滞后。但这在 IE6 或 IE7 中不是问题。

我们发现问题与地图上的标记有关。当您放大并且显示更多标记时,这种情况会更加普遍。

我们使用 dynaTrace 进行了一些基准测试,看来延迟本身并不是由 JS 处理引起的,而是通过 dynaTrace 所说的“渲染”。令人惊讶的是,新版本的 IE 的渲染效果会更差。

I work for a company that built interactive seating charts using Javascript. Here's an example: http://seatgeek.com/event/show/457624/miami-dolphins-at-new-york-jets-2010-12-12/. In many ways they mimic the functionality of Google Maps.

We're dealing with an odd problem--performance for the maps is fine in all browsers except IE8. I'm including IE6 and IE7 in the "all browsers" category. We're seeing markedly worse JS performance in IE8. When you try to drag the map in IE8, it locks up a bit and there's a noticeable lag. But that's not a problem in IE6 or IE7.

We've isolated that the problem is related to the markers on the map. It's much more prevalent when you zoom in and there are more markers displayed.

We've done some benchmarking using dynaTrace and it seems the delay is not caused by JS processing, per se, but rather by what dynaTrace refers to as "rendering". Seems surprising that the newer version of IE would have worse rendering.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

春花秋月 2024-10-07 04:58:39

您是否在 IE8 开发者工具中运行过 Profiler 脚本?它会准确地告诉您每个功能花费了多少时间。

请参阅:链接< /a>

Have you run the script Profiler in the IE8 Developer Tools? It will tell you exactly how much time is spent on each function.

See: Link

只是一片海 2024-10-07 04:58:39

IE8 以不同的方式呈现 PNG。尝试用存根 gif 图像替换它们,看看会发生什么。此外,您的网站速度非常慢:图像没有预加载,而且图像数量很多。这种类型的渲染可以通过 raphaeljs 轻松完成,无需使用任何图像(原始图像可能是矢量——将它们导出为路径并使用 raphael 进行渲染)。

另外,你完全搞砸了压缩:你不需要 Alpha 通道,并且在你的情况下使用调色板要好得多。

IE8 renders PNGs differently. Try replacing them with a stub gif image and see what happens. Also, your site is super slow: images do not get pre-loaded and there is a ton of them. This type of rendering could easily be done by raphaeljs without using any images (the originals are probably vectors -- export them as paths and render with raphael).

Also, you totally screwed up the compression: you don't need the alpha channel and using a palette is a ton better in your case.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文