{"id":27993,"date":"2024-11-24T16:47:21","date_gmt":"2024-11-24T08:47:21","guid":{"rendered":"https:\/\/fwq.ai\/blog\/27993\/"},"modified":"2024-11-24T16:47:21","modified_gmt":"2024-11-24T08:47:21","slug":"%e5%a6%82%e4%bd%95%e4%bb%8e-performance-%e9%9d%a2%e6%9d%bf%e8%af%86%e5%88%ab%e9%98%bb%e5%a1%9e%e9%a1%b5%e9%9d%a2%e6%b8%b2%e6%9f%93%e7%9a%84%e4%bb%bb%e5%8a%a1%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/27993\/","title":{"rendered":"\u5982\u4f55\u4ece Performance \u9762\u677f\u8bc6\u522b\u963b\u585e\u9875\u9762\u6e32\u67d3\u7684\u4efb\u52a1\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173137628026051.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4ece Performance \u9762\u677f\u8bc6\u522b\u963b\u585e\u9875\u9762\u6e32\u67d3\u7684\u4efb\u52a1\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4ece Performance \u9762\u677f\u8bc6\u522b\u963b\u585e\u9875\u9762\u6e32\u67d3\u7684\u4efb\u52a1\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u4ece performance \u9762\u677f\u5206\u6790\u963b\u585e\u9875\u9762\u6e32\u67d3\u7684\u4efb\u52a1<\/strong><\/p>\n<p>\u5728\u6027\u80fd\u4f18\u5316\u4e2d\uff0c\u63d0\u5347 Lighthouse \u8bc4\u5206\u662f\u5e38\u89c1\u7684\u76ee\u6807\u3002\u5176\u4e2d\uff0c\u4f18\u5316\u963b\u585e\u9875\u9762\u6e32\u67d3\u7684\u4efb\u52a1\u662f\u5173\u952e\u6b65\u9aa4\u3002\u90a3\u4e48\uff0c\u5982\u4f55\u4ece Performance \u9762\u677f\u4e2d\u8bc6\u522b\u8fd9\u4e9b\u4efb\u52a1\u5462\uff1f<\/p>\n<p><strong>\u5206\u6790\u9519\u8bef\u533a\u57df<\/strong><\/p>\n<p>\u9898\u4e3b\u63d0\u5230\u7684 Network \u533a\u57df\u9762\u677f\u65e0\u6cd5\u7528\u4e8e\u5206\u6790\u963b\u585e\u9875\u9762\u6e32\u67d3\u7684\u4efb\u52a1\u3002\u6b63\u786e\u7684\u65b9\u6cd5\u662f\u67e5\u770b Performance \u9762\u677f\u4e2d\u7684 Mn \u4e3b\u7ebf\u7a0b\u533a\u57df\u3002<\/p>\n<p><strong>\u67e5\u627e\u6e32\u67d3\u76f8\u5173\u4efb\u52a1<\/strong><\/p>\n<p>\u5728 Main \u533a\u57df\uff0c\u6211\u4eec\u9700\u8981\u5173\u6ce8\u4e0e\u6e32\u67d3\u76f8\u5173\u7684\u4efb\u52a1\uff0c\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>Recalculate Style<\/li>\n<li>Layout<\/li>\n<li>Paint<\/li>\n<li>Commit<\/li>\n<\/ul>\n<p><strong>\u786e\u5b9a\u963b\u585e\u4efb\u52a1<\/strong><\/p>\n<p>\u5728\u8fd9\u4e9b\u6e32\u67d3\u4efb\u52a1\u4e4b\u524d\u6267\u884c\u7684 JS \u4efb\u52a1\u5c31\u662f\u963b\u585e\u9875\u9762\u6e32\u67d3\u7684\u4efb\u52a1\u3002\u8fdb\u5ea6\u6761\u7684\u957f\u77ed\u5e76\u4e0d\u76f4\u63a5\u53cd\u6620\u4efb\u52a1\u7684\u963b\u585e\u65f6\u95f4\u3002<\/p>\n<p><strong>\u793a\u4f8b<\/strong><\/p>\n<p>\u4e0a\u56fe\u5c55\u793a\u4e86 Performance \u9762\u677f\u7684 Main \u533a\u57df\u3002\u5728 Paint \u4efb\u52a1\u4e4b\u524d\u6267\u884c\u7684 JS \u4efb\u52a1\uff0c\u5373\u4e3a\u963b\u585e\u9875\u9762\u6e32\u67d3\u7684\u4efb\u52a1\u3002<\/p>\n<p><strong>\u6e29\u99a8\u63d0\u793a\uff1a<\/strong><\/p>\n<ul>\n<li>\u53ef\u4ee5\u4f7f\u7528 Chrome DevTools \u7684 &#8220;Record page load&#8221; \u529f\u80fd\u8bb0\u5f55\u9875\u9762\u52a0\u8f7d\u8fc7\u7a0b\uff0c\u65b9\u4fbf\u5206\u6790\u3002<\/li>\n<li>\u4f18\u5316\u963b\u585e\u4efb\u52a1\u65f6\uff0c\u5e94\u4fa7\u91cd\u4e8e\u51cf\u5c11\u811a\u672c\u6267\u884c\u65f6\u95f4\u6216\u5c06\u5176\u62c6\u5206\u5230\u591a\u4e2a\u8f83\u5c0f\u7684\u4efb\u52a1\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4ece Performance \u9762\u677f\u8bc6\u522b\u963b\u585e\u9875\u9762\u6e32\u67d3\u7684\u4efb\u52a1\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ece performance \u9762\u677f\u5206\u6790\u963b\u585e\u9875\u9762\u6e32\u67d3\u7684\u4efb\u52a1 \u5728\u6027\u80fd\u4f18\u5316\u4e2d\uff0c\u63d0\u5347 Lighthouse \u8bc4\u5206\u662f\u5e38\u89c1\u7684\u76ee\u6807\u3002\u5176\u4e2d\uff0c\u4f18\u5316\u963b\u585e\u9875\u9762\u6e32\u67d3\u7684\u4efb\u52a1\u662f\u5173\u952e\u6b65\u9aa4\u3002\u90a3\u4e48\uff0c\u5982\u4f55\u4ece Performance \u9762\u677f\u4e2d\u8bc6\u522b\u8fd9\u4e9b\u4efb\u52a1\u5462\uff1f \u5206\u6790\u9519\u8bef\u533a\u57df \u9898\u4e3b\u63d0\u5230\u7684 Network \u533a\u57df\u9762\u677f\u65e0\u6cd5\u7528\u4e8e\u5206\u6790\u963b\u585e\u9875\u9762\u6e32\u67d3\u7684\u4efb\u52a1\u3002\u6b63\u786e\u7684\u65b9\u6cd5\u662f\u67e5\u770b Performance \u9762\u677f\u4e2d\u7684 Mn \u4e3b\u7ebf\u7a0b\u533a\u57df\u3002 \u67e5\u627e\u6e32\u67d3\u76f8\u5173\u4efb\u52a1 \u5728 Main \u533a\u57df\uff0c\u6211\u4eec\u9700\u8981\u5173\u6ce8\u4e0e\u6e32\u67d3\u76f8\u5173\u7684\u4efb\u52a1\uff0c\u5305\u62ec\uff1a Recalculate Style Layout Paint Commit \u786e\u5b9a\u963b\u585e\u4efb\u52a1 \u5728\u8fd9\u4e9b\u6e32\u67d3\u4efb\u52a1\u4e4b\u524d\u6267\u884c\u7684 JS \u4efb\u52a1\u5c31\u662f\u963b\u585e\u9875\u9762\u6e32\u67d3\u7684\u4efb\u52a1\u3002\u8fdb\u5ea6\u6761\u7684\u957f\u77ed\u5e76\u4e0d\u76f4\u63a5\u53cd\u6620\u4efb\u52a1\u7684\u963b\u585e\u65f6\u95f4\u3002 \u793a\u4f8b \u4e0a\u56fe\u5c55\u793a\u4e86 Performance \u9762\u677f\u7684 Main \u533a\u57df\u3002\u5728 Paint \u4efb\u52a1\u4e4b\u524d\u6267\u884c\u7684 JS \u4efb\u52a1\uff0c\u5373\u4e3a\u963b\u585e\u9875\u9762\u6e32\u67d3\u7684\u4efb\u52a1\u3002 \u6e29\u99a8\u63d0\u793a\uff1a \u53ef\u4ee5\u4f7f\u7528 Chrome DevTools \u7684 &#8220;Record page load&#8221; \u529f\u80fd\u8bb0\u5f55\u9875\u9762\u52a0\u8f7d\u8fc7\u7a0b\uff0c\u65b9\u4fbf\u5206\u6790\u3002 \u4f18\u5316\u963b\u585e\u4efb\u52a1\u65f6\uff0c\u5e94\u4fa7\u91cd\u4e8e\u51cf\u5c11\u811a\u672c\u6267\u884c\u65f6\u95f4\u6216\u5c06\u5176\u62c6\u5206\u5230\u591a\u4e2a\u8f83\u5c0f\u7684\u4efb\u52a1\u3002 \u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4ece Performance \u9762\u677f\u8bc6\u522b\u963b\u585e\u9875\u9762\u6e32\u67d3\u7684\u4efb\u52a1\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-27993","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27993","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=27993"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27993\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=27993"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=27993"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=27993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}