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

MSC4224: CBOR Serialization #4224

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

MSC4224: CBOR Serialization #4224

wants to merge 4 commits into from

Conversation

Saiv46
Copy link

@Saiv46 Saiv46 commented Nov 6, 2024

Rendered

Yes, this is basically #3079 but only CBOR part of it, "one bite at a time" and such.

This MSC is written as an individual FOSS contributor. (Disclosure as by matrix-org/matrix-spec#1700)

Signed-off-by: Alexander Ivanov [email protected]

@Saiv46 Saiv46 changed the title WIP: CBOR Serialization MSC4224: CBOR Serialization Nov 6, 2024
@turt2live turt2live added proposal A matrix spec change proposal s2s Server-to-Server API (federation) needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. labels Nov 6, 2024
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also sign off on your changes so we can eventually put this on a track to acceptance.

proposals/4224-cbor-serialization.md Outdated Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation requirements:

  • Client
  • Server

@turt2live turt2live added client-server Client-Server API kind:feature MSC for not-core and not-maintenance stuff and removed s2s Server-to-Server API (federation) labels Nov 6, 2024
Copy link
Member

@kegsay kegsay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a very small stepping stone in the right direction, I think this MSC does a good job. I would say that the lack of enum integer keys makes this kinda useless to do, as the gain is so small. However, the un-base64ing of binary values results in quite a significant improvement for encrypted messages, and that does make enough of a difference imo to encourage servers to support this MSC.

## Potential issues

At the time of writing, this proposal doesn't provide a integer mapping for
string keys and static string values, which leaves out encoding efficiency.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect this is really going to hurt the numbers on this, as short messages are overwhelmingly made up by key names.

at the time of writing is too complex to implement and have not yet been
accepted into the spec, this proposal focuses on CBOR serialization part of it.

## Proposal
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have some example messages to compare JSON vs proposed CBOR sizes and the % reduction. This proposal would have a large benefit on encrypted rooms due to the base64 ciphertexts being un-base64'd. It would have a very small effect on unencrypted data, due to the prolific use of strings as values which don't see any compression benefits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client-server Client-Server API kind:feature MSC for not-core and not-maintenance stuff needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. proposal A matrix spec change proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants