基于Chrome的JavaScript滞后于JavaScript性能 [英] Chrome-based lags on JavaScript performance

查看:85
本文介绍了基于Chrome的JavaScript滞后于JavaScript性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只在Google Chrome浏览器中遇到JavaScript性能问题。问题是,有一段时间网站运行平稳,但几秒钟后,浏览页面就会冻结2到3秒。我认为一个问题可能与同步循环方法调用有关。但是,问题是为什么,即Mozilla Firefox或Microsoft Intenet Explorer不冻结?实际上,我甚至不知道究竟要问什么,但我认为如果有人能够向我展示解决问题的可能方法,我将能够知道答案。为了更清楚地说明问题,我会向您展示Google Chrome时间轴:
谷歌浏览器时间轴http://img840.imageshack.us/img840/5998/timelinen.png
正如您所看到的,它显示了一段时间以后,处理器可以平滑地解析JavaScript,但几秒钟后JavaScript解析只是冻结。



那么,你有什么想法可能导致这种类型的问题?任何帮助,将不胜感激。如果你需要更多的信息,请不要犹豫,问。我会尽力告诉你需要的一切,如果我能认识我自己的话。

解决方案

。我认为谷歌浏览器在图像处理方面存在性能问题。 Mozila的火狐和歌剧作品更流畅。



如果您有大精灵(大于2000x2000),请尝试将其拆分为小块。


I have a problem with JavaScript performance only on Google Chrome browser. The problem is that for some time website is running smoothly, but after several seconds browsing the page just freezes for 2 or 3 seconds. I think an issue could be with synchronaus ar cyclic method calls. But then the question is why, i.e., Mozilla Firefox or Microsoft Intenet Explorer do not freeze?

Actually, I don't even know what exactly to ask, but I think I will be able to know the answer if someone of you could show me possible ways to solve the problem. To make matters more clear, I will show you Google Chrome Timeline I got: Google Chrome Timeline http://img840.imageshack.us/img840/5998/timelinen.png As you can see, it shows that for some time processor parses JavaScript smoothly, but after several seconds JavaScript parsing just freezes.

So, do you have any ideas what could cause such type of problem? Any help would be appreciated. If you need more info, do not hesitate to ask. I will try to tell everything you need if I will know myself.

解决方案

I have something like that when I used very big sprite. I think google chrome has a performance problem with image processing. Mozila firefox and opera works smoother.

If you have big sprite (bigger than 2000x2000) try to split to smaller pieces.

这篇关于基于Chrome的JavaScript滞后于JavaScript性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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