Upgrade to Pro — share decks privately, control downloads, hide ads and more …

jsconfeu 2018

jsconfeu 2018

NodeGirls で発表した jsconfeu 2018 の話です。

D76231a2114896dfcc7b79ac69558b79?s=128

Yosuke Furukawa
PRO

June 20, 2018
Tweet

Transcript

  1. jsconf.eu 2018 2018/06/20 @ Recruit Technologies

  2. Twitter: @yosuke_furukawa Github: yosuke-furukawa

  3. jsconf.eu 2018

  4. Ұ൪໘ന͔ͬͨͷ

  5. None
  6. Ұ൪໘ന͔ͬͨͷ͸ίϨ ͚ͩͲɻɻɻ

  7. ৄࡉ͸͜͜Ͱ࿩͠·͢

  8. ͓΋͠Ζ͔ͬͨηογϣϯ 3ͭ঺հ EFOPҎ֎ͷ

  9. None
  10. ૊৫ͷͨΊͷഉଞతͳߦҝͷݮ Β͠ํ • ܭଌͰ͖ͳ͍΋ͷ͸؅ཧͰ͖ͳ͍ • Ͳ͏΍ͬͯ૊৫Λվળ͢Δ͔ɺͱ͍͏૊৫վ ળͷ࿩ • ·͔͞ JavaScript

    ͷΧϯϑΝϨϯεͰ૊৫վ ળωλΛฉ͘ͱ͸ɻɻɻ
  11. None
  12. ૊৫ͷͨΊͷഉଞతͳߦҝͷݮ Β͠ํ • ͢΂ͯͷεςʔΫϗϧμʔ͕Ͳ͏ײ͡Δ͔Λ૝ ૾ͯ͠ɺͦͷίΞόϦϡʔΛఆٛ͠ͳ͍͞ • ܭଌͰ͖ͳ͍΋ͷ͸੒ޭ͔ͨ͠Ͳ͏͔΋ଌΕͣɺ ͦΕʹΑͬͯݕূ΋Ͱ͖ͳ͍ͷͰɺܭଌͯ͠ς ετ͠ͳ͍͞ •

    ςετͨ͠Βͦͷ݁ՌΛඪ४Խͯ͠޿Ίͳ͍͞
  13. ૊৫ͷͨΊͷഉଞతͳߦҝͷݮ Β͠ํ • ૝૾͢Δ͜ͱ • ఆٛ͢Δ͜ͱ • ద༻͢Δ͜ͱ • ݕূ͢Δ͜ͱ

    • ඪ४Խ͢Δ͜ͱ • ͜ΕΒΛܧଓతʹ࣮ࢪ͢Δ͜ͱ
  14. None
  15. https://ejzimmer.github.io/event-loop-talk/#/

  16. Event Loop ͬͯΑ͘ฉ͚͘Ͳ Կʁ • Taskͷ؅ཧͷͨΊͷΩϡʔʢΈ͍ͨͳ΋Μʣ • TaskͬͯͳʹΑʁ document.body.addEventListener('keydown', (event)

    => { if (event.key === 'PageDown') { location.href = "/#/36"; } }); ͜͜ͷ͜ͱ
  17. Event Loop ͬͯΑ͘ฉ͚͘Ͳ Կʁ

  18. Event Loop ͬͯΑ͘ฉ͚͘Ͳ Կʁ • Taskͷ؅ཧͷͨΊͷΩϡʔʢΈ͍ͨͳ΋Μʣ • TaskͬͯͳʹΑʁ document.body.addEventListener('keydown', (event)

    => { if (event.key === 'PageDown') { location.href = "/#/36"; } }); ͜͜ͷ͜ͱ
  19. Event Loop ͬͯΑ͘ฉ͚͘Ͳ Կʁ • Πϕϯτϧʔϓʹ͍ͭͯղઆͯ͠Έͨ • ࠷ۙ͸Taskͱ͍ͬͯ΋simpleͰ͸ͳ͘ɺPromise ͷmicrotask΍webworkerΛ࢖ͬͨผεϨου΋ ଘࡏ͢Δ

    • Node.jsͷEventLoop΋·ͨಛ௃త setImmediate ΍ process.nextTick ͕͋ͬͨΓɻ
  20. None
  21. None
  22. None
  23. None
  24. None
  25. TCPͷղઆ • ΊͪΌͪ͘Ό໘ന͔ͬͨɻ • Slow Start ͷղઆͱͯ͜͠ΕҎ্ແ͍͘Β͍ຊ࣭ Λଊ͑ͯͨɻ • Head

    of Line blocking ΛύϯέʔΩΛ৯΂͗ͯ͢ ৯΂ΒΕͳ͘ͳͬͨঢ়ଶͱදݱͯͨ͠ͷ͸ਧ͍ͨ • രস͠ͳ͕ΒݟΕͨؾ͕͢Δɻ
  26. None