queueMicrotask

https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/queueMicrotask

scope.queueMicrotask(function);

https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#microtask-queuing


self.queueMicrotask(() => {
// function contents here
}) MyElement.prototype.loadData = function (url) {
if (this._cache[url]) {
queueMicrotask(() => {
this._setData(this._cache[url]);
this.dispatchEvent(new Event("load"));
});
} else {
fetch(url).then(res => res.arrayBuffer()).then(data => {
this._cache[url] = data;
this._setData(data);
this.dispatchEvent(new Event("load"));
});
}
};

https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide


macrotask & microtask

https://javascript.info/event-loop

https://zh.javascript.info/event-loop


浅析JS堆、栈、执行栈 和 EventLoop

https://mp.weixin.qq.com/s/Vydvo1PVGgr9zGbYsubX5w

Event loops 秒懂

https://github.com/wangmeijian/blog/blob/master/docs/Event loops秒懂.md

宏任务 task & 微任务 microtask

https://zh.javascript.info/event-loop

https://zh.javascript.info/microtask-queue

critical-rendering-path

前端性能优化

https://developers.google.com/web/fundamentals/performance/critical-rendering-path/render-tree-construction

https://developers.google.com/web/fundamentals/performance/critical-rendering-path/constructing-the-object-model?hl=zh-cn



xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


最新文章

  1. D3.js学习(三)
  2. BigDecimal 加减乘除
  3. ubuntu安装erlang
  4. ngModel 值不更新/显示
  5. 士兵站队问题sol
  6. 转-CSS3 圆角(border-radius)
  7. 上架app 到app store 的出现: “The IPA is invalid. It does not inlude a Payload directory.”错误处理
  8. 编译器的未来——我们还需要C++么?
  9. Ubuntu 14.0操作系统,修改默认打开方式的方法
  10. Jquery实现图片左右滚动(自动)
  11. 在jdbc中使用properites文件进行使用
  12. [Swift]LeetCode622. 设计循环队列 | Design Circular Queue
  13. oracle总结--增删改查
  14. 006 python操作符
  15. LeetCode - 768. Max Chunks To Make Sorted II
  16. 通过django的rest-framework……(CBV)
  17. Mysql学习(一)添加一个新的用户并用golang操作Mysql
  18. [troubleshoot][archliunx][chromium][flash] chrome提示flash不是最新
  19. c#关于字符串格式化
  20. 674. Longest Continuous Increasing Subsequence

热门文章

  1. 获取当前文件路径 import 原理 一般把模块组成的集合称为包(package)
  2. vue组件中data为什么必须是一个函数?
  3. Excel 快速填充:填充柄+数据验证
  4. 用java实现word转pdf
  5. nginx常用功能和配置
  6. Hbase 表的设计原则 ————总结
  7. mysql高级day4
  8. OpenCV4.4.0 安装测试 Installation & Examination (Ubuntu18.04, Ubuntu 20.04)
  9. Codeforces Round #547 (Div. 3) C. Polycarp Restores Permutation (数学)
  10. 一张图解决ThreadLocal