Reactのパフォーマンス改善例
by
rakus frontend
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
ReactͷύϑΥʔϚϯεվળྫ
Slide 2
Slide 2 text
ࠓͷ͓ https://web.dev/articles/rail?hl=ja
Slide 3
Slide 3 text
RAILϞσϧͱ RAILGoogleࣾͷ։ൃऀͰ͋Δ Ilya Grigorik ࢯ͕ఏ এͨ͠ύϑΥʔϚϯεϞσϧͰ͢ɻ ग़యɿWebϑϩϯτΤϯυϋΠύϑΥʔϚϯενϡʔχϯά RAILɺResponse, Animation, Idle, Loadͷ֤୯ޠͷ ಄จࣈΛऔ໊͚ͬͯΒΕ·ͨ͠ɻ RAILɺϢʔβʔΛத৺ͱͨ͠ύϑΥʔϚϯεϞσϧ Λඪᒗ͠·͢ɻ
Slide 4
Slide 4 text
ࠓͷ͓ https://web.dev/articles/rail?hl=ja 👉
Slide 5
Slide 5 text
Responseͱ ResponseɺϢʔβʔ͕ԿΒ͔ͷΞΫγϣϯʹର͠ ͯΣϒϖʔδ͕ϢʔβʔΠϯλʔϑΣΠε্ͷมԽ ΛҾ͖ىͯ͜͠ɺԠ͢Δ·Ͱͷ࣌ؒΛࢦ͠·͢ɻ
Slide 6
Slide 6 text
Responseͱ
Slide 7
Slide 7 text
Responseͱ 👉 Googleఏএඪ
Slide 8
Slide 8 text
Responseͱ 👉 ݱ࣮తͳඪ
Slide 9
Slide 9 text
ϥΫεϓϩμΫτʹ͓͚Δ 500ߦͷςʔϒϧ
Slide 10
Slide 10 text
ϥΫεϓϩμΫτʹ͓͚Δ (ms) 1ճ 2ճ 3ճ 4ճ 5ճ 6ճ 7ճ 8ճ 9ճ 10ճ res 2306 2698 2523 3122 2546 2472 2382 2872 2619 2465 2659ms 75ύʔηϯλΠϧ
Slide 11
Slide 11 text
ϘτϧωοΫௐࠪ React Developer Tools
Slide 12
Slide 12 text
ෆཁͳϨϯμϦϯάͷݮ ίϯϙʔωϯτ͕࠶ϨϯμϦϯά͞Εͨཧ༝Λ ϩάग़ྗͯ͘͠ΕΔϥΠϒϥϦ https://github.com/welldone-software/why-did-you-render
Slide 13
Slide 13 text
ෆཁͳϨϯμϦϯάͷݮ install vite.config.ts main.tsx
Slide 14
Slide 14 text
ෆཁͳϨϯμϦϯάͷݮ
Slide 15
Slide 15 text
ෆཁͳϨϯμϦϯάͷݮ ؔςʔϒϧηϧίϯϙʔωϯτͷϝϞԽΛߦ͏
Slide 16
Slide 16 text
ෆཁͳϨϯμϦϯάͷݮ ͪΐͬͱͨ͠ίʔυͷॻ͖ํͷҧ͍Ͱ ϝϞԽ͕ޮ͔ͳ͘ͳΔͨΊҙ͢Δ 👎 👍
Slide 17
Slide 17 text
ෆཁͳϨϯμϦϯάͷݮ ͪΐͬͱͨ͠ίʔυͷॻ͖ํͷҧ͍Ͱ ϝϞԽ͕ޮ͔ͳ͘ͳΔͨΊҙ͢Δ
Slide 18
Slide 18 text
ෆཁͳϨϯμϦϯάͷݮ
Slide 19
Slide 19 text
ෆཁͳϨϯμϦϯάͷݮ վળલ վળޙ
Slide 20
Slide 20 text
ύϑΥʔϚϯεൺֱ (ms) 1ճ 2ճ 3ճ 4ճ 5ճ 6ճ 7ճ 8ճ 9ճ 10ճ վળલ 2306 2698 2523 3122 2546 2472 2382 2872 2619 2465 վળޙ 465 481 503 562 561 479 545 483 498 491 2659ms 524ms 🎉
Slide 21
Slide 21 text
վળલ վળޙ
Slide 22
Slide 22 text
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠