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

What can webdev learn from game developers?

What can webdev learn from game developers?

Łukasz Niemier

December 18, 2018
Tweet

More Decks by Łukasz Niemier

Other Decks in Programming

Transcript

  1. Solutions • Intrusive lists • Better CPU cache utilisation •

    Makes structures look „weird” • Entity-Component-System • Try to manage data independently form logic • Separate of concerns • Datagram protocols • Connection-less communication • Loosing package isn’t a problem
  2. Entity-Component-System • Component - collection of data • Should be

    small • Contain no logic • Entity - collection of Components • In general sense - common ID for the components • System - logic over Components • Contain logic • Modifies one or more components • Do not care about Entities • Listen on events in log
  3. Entity-Component • Patient • Name (first name, last name) •

    Vitals (pulse, body temp., etc.) • Illness • Practitioner • Name • Authentication • License
  4. Pros • Adding features to entities is simple • Making

    snake jumpy is as simple as adding component to it • Removing features is simple • Making rabbit immovable is as simple as removing component from it • You can dynamically add features to entities • Less edge cases, as system is not aware of the entities that do not contain given components
  5. Cons • Eventually consistent • Systems tends to grow and

    touch a lot of components at once • Unexplored technique in webdev land
  6. TCP - pros • Nice when you can keep connection

    open • Quality of Service • Guarantee of delivery • TLS
  7. TCP - cons • No multihoming (at least in IPv4)

    • One missing package will delay all next messages until delivered • Three-way handshake
  8. Hello, would you like to hear a TCP joke? Yes,

    I'd like to hear a TCP joke. OK, I'll tell you a TCP joke. OK, I'll hear a TCP joke. Are you ready to hear a TCP joke? Yes, I am ready to hear a TCP joke. OK, I'm about to send the TCP joke. It will last 10 seconds, it has two characters, it does not have a setting, it ends with a punchline. OK, I'm ready to hear the TCP joke that will last 10 seconds, has two characters, does not have a setting and will end with a punchline. I'm sorry, your connection has timed out... ...Hello, would you like to hear a TCP joke?
  9. UDP • Connectionless • No delivery guarantees • No QoS

    • No congestion negotiation - can cause package drops
  10. QUIC • Implementing TCP guarantees on top of UDP •

    Still connectionless • Encrypted • No three way handshake • Multihoming • Implemented in user space • Non-blocking on missing packages
  11. HTTP 3 = HTTP 2 over QUIC • Multi-network connections

    handled via multihoming • Faster delivery, even better than via HTTP 2 push • Encryption „reusage” • Less traffic when establishing encryption suite