Skip to content

Improve compression of ImDrawData buffers #1

Description

@ggerganov

Description

It is essential for the successful application of this WebSocket approach to minimise the amount of network traffic between the server and the clients. The WebSocket spec allows for extensions that perform general compression on the transmitted data, but it can only do so much. A custom approach, handcrafted for ImDrawData could significantly reduce the network traffic.

Current implementation

The differences are calculated per ImDrawList. For each ImDrawList, we store the position of the first vertex and subtract this value from all vertices in the draw list. This makes the ImDrawList invariant to shifts. The client takes care to restore the position offset before rendering the data.

If the current ImDrawList curList has the same size as it had in the previous frame prevList - the binary contents of curList and prevList are xored and run-length encoded. Otherwise - we send the full curList.

Ideas to explore

  • Per DrawList differences
  • Deinterleave ImDrawVtx fields
  • Rate control of focused/hovered windows
  • Alternative ImDrawList structure

Activity

  1. changed the title [-]Improve compression of Dear Imgui's DrawData difference between consecutive frames[/-] [+]Improve compression of Dear Imgui's DrawData buffers[/+] on Jul 1, 2019
  2. changed the title [-]Improve compression of Dear Imgui's DrawData buffers[/-] [+]Improve compression of ImDrawData buffers[/+] on Jul 1, 2019
  3. pinned this issue on Jul 1, 2019
  4. added 2 commits that reference this issue on Jul 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions