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

NodeJS worker threads

NodeJS worker threads

This slide deck was presented at DevFest Live 2021

Srushtika Neelakantam

June 16, 2021
Tweet

More Decks by Srushtika Neelakantam

Other Decks in Technology

Transcript

  1. USING NODE JS WORKER THREADS Srushtika Neelakantam | DevFest Live

    2021
  2. Developer Relations and Partner Engineer I’m @Srushtika

  3. b @Srushtika | @ablyrealtime | @DevFestLive

  4. PEER TO PEER STRATEGY @Srushtika | @ablyrealtime | @DevFestLive player1

    player2 player3 player4 player5 O(n2) time complexity
  5. CLIENT/SERVER STRATEGY server player1 player2 player3 @Srushtika | @ablyrealtime |

    @DevFestLive O(n) time complexity
  6. b @Srushtika | @ablyrealtime | @DevFestLive

  7. b @Srushtika | @ablyrealtime | @DevFestLive

  8. HTTP @Srushtika | @ablyrealtime | @DevFestLive vs WEBSOCKETS

  9. PUBLISH/ SUBSCRIBE PATTERN P.S. This is an old gif, Ably

    has moved on to new branding now @Srushtika | @ablyrealtime | @DevFestLive FEATURES • Presence • Message History • Integrations . . . INFRASTRUCTURE • Auto reconnection • Scale • Guaranteed delivery • Message ordering . . .
  10. PUBLISHING THE GAME STATE @Srushtika | @ablyrealtime | @DevFestLive

  11. b @Srushtika | @ablyrealtime | @DevFestLive

  12. NODE.JS GAME SERVER @Srushtika | @ablyrealtime | @DevFestLive

  13. KEY ELEMENTS THAT MAKE NODE JS WORK NODE JS The

    chrome v8 engine converts JavaScript to machine readable code The libuv library provides and manages the event loop and thread pool @Srushtika | @ablyrealtime | @DevFestLive
  14. “What the heck is the event loop anyway” by Philip

    Roberts (JSConfEU on YouTube) @Srushtika | @ablyrealtime | @DevFestLive
  15. —VARIOUS PEOPLE ON THE INTERNETS “Node.js is a CPU bottleneck

    due to its single-threaded nature. That’s one of its major drawbacks” @Srushtika | @ablyrealtime | @DevFestLive
  16. The answer? @Srushtika | @ablyrealtime | @DevFestLive

  17. NODE JS WORKER THREADS ARCHITECTURE Credits: The NodeSource Blog @Srushtika

    | @ablyrealtime | @DevFestLive
  18. @Srushtika | @ablyrealtime | @DevFestLive

  19. CREDITS: This presentation template was created by Slidesgo, including icons

    by Flaticon, and infographics & images by Freepik THANKS! Do you have any questions? @Srushtika | @ablyrealtime | @DevFestLive