衡量Javascript性能 [英] Measure Javascript performance

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

问题描述

我正在尝试对我们的前端进行全面分析,我想知道是否有任何工具可以自动测量Javascript。

I'm trying to do a full analysis of our front end and I'd like to know if there are any tools that can measure Javascript automatically.

例如:


  • 执行函数(无需我在记录之前/之后手动输入日期对象)

  • 我页面上的哪个脚本最慢,为什么

  • 找出我需要优化哪些功能

  • 是否有任何jQuery改进我可以做(除了通过John Resig的 jquery-profile.js

    • 我可以使用的更好的选择器

    • 某些对象的记忆

    • 使用更好的功能(例如:使用find因为它更快)

    • Execution of functions (without the need for me to manually put date objects before/after to record this)
    • What script on my page is the slowest and why
    • Find out which functions I need to optimize
    • Are there any jQuery improvements I could make (other than through John Resig's jquery-profile.js)
      • Better selectors I could use
      • Memoization on certain objects
      • Use of a better function (eg: use find because it's faster)

      我非常想为我的JS寻找一个分析器(还有一些jQuery的东西),除了像Firebug这样的东西, Chrome开发工具,Yslow / Page速度插件等等。我正在寻找比JSlint或jsPe更好的东西RF。

      I'm pretty much looking for a profiler for my JS (and something that also profiles jQuery stuff), other than things like Firebug, the Chrome Dev Tools, Yslow/Page speed plugins etc. I'm looking for something better than JSlint or jsPerf.

      我在我的应用程序上运行New Relic,但它没有告诉我脚本缺少的位置。

      I have New Relic running on my app, but it doesn't tell me where my scripts are lacking.

      我希望有一种更简单的方式来分析我的JS,而不是手动操作。我需要一个完整分析的解决方案,并给我一个包含指标的报告。

      I was hoping there was an easier way to profile my JS than to do it manually. I need a drop in solution that does full analysis and gives me a report with metrics.

      推荐答案

      我认为你在找东西像这样:

      I think you are looking for something like this:

      https:// developers.google.com/web-toolkit/speedtracer/

      从doc intro到此:

      from doc intro to this:

      使用Speed Tracer,您可以更好地了解
      在应用程序中花费的时间。这包括由
      JavaScript解析和执行,布局,CSS样式重新计算和
      选择器匹配,DOM事件处理,网络资源加载,计时器
      fires,XMLHttpRequest回调,绘画等引起的问题。

      Using Speed Tracer you are able to get a better picture of where time is being spent in your application. This includes problems caused by JavaScript parsing and execution, layout, CSS style recalculation and selector matching, DOM event handling, network resource loading, timer fires, XMLHttpRequest callbacks, painting, and more.

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

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