Search Unity

Question A quesstion about stream aligned.

Discussion in 'Netcode for GameObjects' started by qpuilie, Jun 21, 2021.

  1. qpuilie

    qpuilie

    Joined:
    Jan 14, 2020
    Posts:
    69
  2. luke-unity

    luke-unity

    Joined:
    Sep 30, 2020
    Posts:
    306
    If your stream is unaligned (lets say you wrote 3 bits already) and then you write something like a ulong (8 bytes) this ulong will not just be written into a single memory location but instead 7 bytes and 5 bits will be written into the first location and the remaining 3 bits into the next one. This can be much slower because the CPU needs to perform more than twice the operations.
     
    qpuilie likes this.
  3. qpuilie

    qpuilie

    Joined:
    Jan 14, 2020
    Posts:
    69
    Thanks for your answer!;)