Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Offset abuse, stripped hex #12

Open
whosmatt opened this issue Dec 28, 2022 · 0 comments
Open

Feature request: Offset abuse, stripped hex #12

whosmatt opened this issue Dec 28, 2022 · 0 comments
Assignees

Comments

@whosmatt
Copy link

Offset abuse

Most servers (pixel, pixelflut-server-dotnet, shoreline...) support
OFFSET <x> <y>

Depending on the screen size, abuse of OFFSET yields a significant efficiency increase in efficiency.
By splitting the image into blocks (e.g. 100x100 or 10x10), prepending each block with an offset command and sending relative coordinates the amount of bytes sent can be reduced.

For a 1280x720 full hex image, a block size of 100x100 yields a 12% reduction in bytes to be transmitted.
A block size of 10x10 yields a 22% reduction.
Potential efficiency gain scales with canvas size.
The theoretical maximum is yet to be determined, and further optimization is possible by dynamically adjusting block size.

When using a fixed number of connections/threads with multiple blocks being handled by one connection, the blocks need to be sent sequentially and ideally as a concatenated byte stream.

Stripped hex

When sending hex values with less than 6 digits, servers seem to behave the same and add leading zeroes. All hex values can be optimized by stripping up to 5 zeroes from the left.

@SpeckiJ SpeckiJ self-assigned this Jan 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants