你如何做页面性能测试? [英] How do you do page performance tests?

查看:174
本文介绍了你如何做页面性能测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道每个读过这个问题的人都会认为Firebug!马上。也许有人会认为YSlow!和Google Page Speed!



尽管我非常喜欢这些工具,但我更关心IE 6/7/8中页面的快速渲染。所有上述工具都需要Firefox。这一切都很好,你可以肯定地测试获取页面到浏览器的底层速度,但是当涉及到实际渲染页面时呢?



我还没有看到关于如何在浏览器级别测试优化的任何非常好的答案。如何在不同的浏览器上编写HTML / JS的性能测试?

我不确定这是一个有用的努力来优化仅针对一个供应商:关于HTML,大多数浏览器都是针对标准布局技术(表格,无表格等)进行优化编写的,其中包括:



  • 在IE6和IE8之间,渲染引擎的价格相差
    ,因此
    就像两个不同的
    浏览器一样

  • 大多数优化
    的技术都是跨浏览器的标准(在底部放置
    javascript,因此您不需要
    块页面加载,将javascript移动到
    外部文件,使用多个主机名
    用于图片等,以便利用
    并行加载,不要使用表
    作为整体布局,确保缓存
    标题正确等。)
    li>
  • 一旦您的网站针对Firefox进行了优化,我认为只要对IE进行调整,就可以获得更多的收益;除非您的站点基本上是静态内容,否则您可以在应用程序级别执行更多操作(优化查询等),在这种情况下,您可以调查缓存,HTTP压缩等。

  • 如果您的关注实际上是在优化用于IE的Javascript代码,那么有许多优秀的跨浏览器JavaScript库在跨浏览器平台的最佳执行时间进行武器竞赛,所以再次选择跨浏览器解决方案是要走的路

  • 浏览器环境不断发展,您的客户可能会在某个时间点转向另一个平台;现在,针对多种不同的浏览器进行优化最终会获得更多兼容的代码,这些代码在未来的某个时间点进行平台更​​改时可能会表现得更好。

  • 我认为,浏览器优化的代码将导致一个更可维护的代码库和更少的魔术IE黑客,其存在的理由很快就会在时间的流逝中丢失


I know everyone who reads the question will think "Firebug!" right away. Maybe some will think "YSlow!" and "Google Page Speed!"

While I really like these tools, I'm more concerned with how the quickly the page will render in IE 6/7/8. All of the above tools require Firefox. That's all fine and you can definitely test the underlying speed of getting the page to the browser but what about when it comes to actually rendering the page?

I haven't seen any really good answers on how to test optimization at the browser level. How do you write performance tests for HTML/JS across difference browsers?

解决方案

I am not sure it is a useful endeavor to optimize for only one vendor:

  • regarding HTML, most browsers are written to optimize for standard layout techniques (tables, table-less, etc.)
  • the rendering engines are quite different between IE6 and IE8, so already that is like two different browsers
  • most of the techniques for optimizing are standard across browsers (put javascript at bottom so you don't block page loads, move javascript to external file, use multiple hostnames for images etc. to take advantage of parallel loading, don't use tables for overall layout, make sure caching headers are correct, etc.)
  • once you have a site optimized for Firefox, I would argue there is little more to be gained as far as tweaking it for IE; there is probably more you can do at the application level at this point (optimize queries, etc.), unless your site is largely static content, in which case you can investigate caching, HTTP compression, etc.
  • if your concern is actually in optimizing Javascript code for IE, then there are many good cross-browser Javascript libraries that are in an arms-race for best execution times across browser platforms, so again, picking a cross-browser solution is the way to go
  • the browser landscape is constantly evolving, and your customers are likely to move on to another platform at some point down the road; optimizing for several different browsers now will end up with more compatible code that is more likely to perform well when a platform change is made at some point in the future
  • I would argue that writing cross-browser optimized code will result in a more maintainable code base with fewer magic IE hacks, whose reason for existence will soon be lost in the mists of time

这篇关于你如何做页面性能测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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