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. vue后台项目

    https://github.com/PanJiaChen/vue-element-admin

  2. RQNOJ 34 紧急援救

    题目描述 话说2007年8月5日,Mike博士神秘失踪了,最后发现是被外星人绑架了,幸好外星人目前还是在地球上活动,并且知道外星人不了解地球,幸好,Milk博士身上有无线信号发送装置,我们终于确定了他 ...

  3. Handler 源码分析

    Handler用法: 无参 Handler 构造函数实例化一个 Handler 类型的全局变量,并重写其 handleMessage 方法,在某一方法内调用 Handler 的 sendEmptyMe ...

  4. VS2013的Release模式 和 debug 模式

    在有的情况下,我们可能不能直接利用Debug模式进行程序调试,那么如何在Release模式下进行程序调试呢? 一.将项目属性设置为Release,生成--->配置管理器: 二.按Alt+F7,弹 ...

  5. python 二分法查找思考理解小白向け

    首先说一下二分法查找的思路.这是面向小白的课程,大佬请让步谢谢 给定一个有序的序列(必须是排好序的)例如[1,2,3,4,5,6,7,8,9,10,20,30,400],然后我们查询一个元素出现的坐标 ...

  6. windows 添加自助白名单

    由于公司分部用的是动态IP,又需要用到总部的OA系统,OA完全开放对外不安全,所以写了这个工具 项目地址 https://github.com/cainiaoit/Windows-firewall-s ...

  7. HDU5487 Difference of Languages(BFS)

    题意:给你两个自动机,求出最短的(如果有相同最短的则求出字典序最小的)能被其中一个自动机接收而不能被另外一个自动机接收的字符串. 一看是自动机以为是神题,后来比赛最后才有思路. 两个自动机的状态都是小 ...

  8. pythontips(2):hasattr的用法

    class Xiaorui: def __init__(self): self.name = 'xiaorui' def setName(self, name=''): if name.strip() ...

  9. Guava源码学习(一)Optional

    基于版本:Guava 22.0 Wiki:Using and avoiding null 0:Optional简介 null在很多场景下会引发问题,NullPointerException困扰过无数的 ...

  10. thinkphp函数学习(2)——microtime, memory_get_usage, dirname, strtolower, is_file

    1. microtime() 返回  微秒 秒  这种格式的内容 例子 <?php echo(microtime()); ?> 输出: 0.25139300 1138197510 // 前 ...