Your page is showing high CPU usage and spinning up your laptop fan, but nothing is visibly happening. What is it doing, and why is it so slow?

This lesson is a real-world performance diagnosis of this very page, right here on egghead. Two infinite (but hidden) animations were causing CPU usage to spike, and Chrome's Task Manager and Performance tools helped uncover the elements causing the problem. You'll see how to use the profiler to record a snapshot, and learn a trick for discovering animations running in the background.

Souce video

There numbers of things you can do to detect a slow page

1. Check the CPU usage

2. Bring up the chrome dev tool, performance monitor, pretty much you can say above 10% CPU usage is high

3. Record the Performance in dev tool to see any 'Layout' event, usually Layout event cause the DOM re-render, so we need to be carefully about this.

  If there is such, check which element it is and try to solve the problem. For example, a hidden svg loading spinner, can cause the problem, we can set it to 'display: none', so it remove from the DOM

4. If there is any animation happens, we can do:

window.onanimationiteration = console.log

It will prints out when animation happens, so we can know that whether there is any unnecessary animation in the background.

[Debug] Diagnose a Slow Page Using Developer Tools的更多相关文章

  1. Can I prevent the Firefox developer tools network panel from clearing on page reload?

    Can I prevent the Firefox developer tools network panel from clearing on page reload? I couldn't fin ...

  2. Developer tools

    20. Developer tools Spring Boot includes an additional set of tools that can make the application de ...

  3. How to Build Office Developer Tools Projects with TFS Team Build 2012

    Introduction Microsoft Visual Studio 2012 provides a new set of tools for developing apps for Office ...

  4. Chrome的开发者工具(Chrome Developer Tools)

    Chrome的开发者工具(Chrome Developer Tools) 按F12 https://developer.chrome.com/devtools/index http://www.w3s ...

  5. 浏览器开发调试工具的秘密 - Secrets of the Browser Developer Tools

    来源:GBin1.com 如果你是一个前端开发人员的话,正确的了解和使用浏览器开发工具是一个必须的技能. Secrets of the Browser Developer Tools是一个帮助大家了解 ...

  6. Chrome调试工具Developer Tools——前端必备神器

    本文链接:https://blog.csdn.net/u012542647/article/details/79401485 今天要给大家介绍一个神器,就是谷歌浏览器(Chorme)自带的前端调试工具 ...

  7. Chrome Developer Tools:Network Panel说明

    官方资料:Chrome Developer Tools: Network Panel 一.chrome Developer Tools:Network Panel 从网络面板中可以获取很多有用信息,如 ...

  8. eclipse中jsp文档无语法着色,安装Eclipse Java Web Developer Tools插件

    一.安装Eclipse Java Web Developer Tools插件 1.eclipse菜单:help/install New Software,打开Available Software窗体: ...

  9. React Developer Tools 安装小提示

    1,在google市场里边,安装React Developer Tools之后,发现是开启的,但是按下F12后,并没有发现react选项 2,后来通过查资料,发现必须是运行react项目的时候,才出现 ...

随机推荐

  1. ACMUniversity

    描述 在大学里,很多单词都是一词多义,偶尔在文章里还要用引申义.这困扰Redraiment很长的时间. 他开始搜集那些单词的所有意义.他发现了一些规律,例如 “a”能用“e”来代替, “c”能用“f” ...

  2. Numpy基本数据结构

    Numpy数组是一个多维数组对象,称为ndarray.其由两部分组成: 1 实际的数据 2 描述这些数据的元数据 一 ndarray的方法 # 多维数组ndarray import numpy as ...

  3. HDU2041 简单DP+规律

    超级楼梯 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submis ...

  4. WCF技术剖析 Two

    WCF终结点和寻址之--AddressHead信息匹配代码 Contracts契约 using System; using System.Collections.Generic; using Syst ...

  5. GitHub上README写法暨markdown语法解读

    原文: GitHub上README写法暨markdown语法解读 自从开始玩GitHub以来,就 越来越 感觉它有爱.最近对它的 README.md 文件颇为感兴趣.便写下这贴,帮助更多的还不会编写R ...

  6. js date扩展方法

    /* File Created: 四月 28, 2015 */ //日期加上天数得到新的日期 //dateTemp 需要参加计算的日期,days要添加的天数,返回新的日期,日期格式:YYYY-MM-D ...

  7. python urllib2 常见请求方式

    GET 添加headers头import urllib2 request = urllib2.Request(uri) request.add_header('User-Agent', 'fake-c ...

  8. 【排序算法】java实现

    1.冒泡排序 最简单的排序实现,冒泡排序,是一种交换排序,它的基本思想是:两两比较相邻记录的关键字,如果反序则交换,直到没有反序的记录为止. //冒泡排序 private int[] bubbleSo ...

  9. ADO 右键问题,当dbgrideh非只读的时候,会遇到这个问题

    /// <summary> /// 再选中列上右键造成,选中这列的状态变化的情况的修复 /// </summary> procedure TfrmMain.XuanYouJia ...

  10. SqlServer 2014安装指引

    具体步骤看整理的Word文档 链接:https://pan.baidu.com/s/1zOhaFVpro2DNnJlJ6dbSEg 密码:lj4m 具体步这里不介绍了,这里记录下报错信息 这个是说系统 ...