> For the complete documentation index, see [llms.txt](https://dotsnet.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dotsnet.gitbook.io/docs/user-manual/compression.md).

# Compression

**DOTSNET** is extremely fast. It’s so fast, that we are currently bandwidth limited. The more we optimize bandwidth, the more Entities we can sync over the network.

**DOTSNET** has a Compression class with a few helper functions like`De/CompressQuaternion`. Those can be used in NetworkMessage `Serialize`/`Deserialize` functions to compress data.

For example, writing a `quaternion` rotation usually takes **16 bytes**:

```csharp
public bool Serialize(ref BitWriter writer) =>
    writer.WriteQuaternion(rotation);
```

But most of the time we can compress it down to **4 bytes**:

```csharp
public bool Serialize(ref SegmentWriter writer) =>
    writer.WriteQuaternionSmallestThree(rotation);
```

If you run into bandwidth issues, you will understand why we go through the hassle of compression.
