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

fix(cast): Reduce size of Cast update messages #4644

Merged

Conversation

joeyparrish
Copy link
Member

Our Cast API sends update messages from receiver to sender, and we have observed before that there is a hidden limit on the size of those messages. A test was written long ago to catch unexpected increases in message sizes, and it has recently started failing.

Our original limit on individual messages was set to 6kB, but later raised to 7kB to silence test failures. Our original goal was to keep messages well under 8kB. We also had a limit on the average message size of 3kB (over 50 messages).

This change greatly reduces the sizes of individual messages by splitting out updates to certain getters into their own messages. These are the getters that produce the most data: getConfiguration(), getStats(), getVariantTracks(), and getTextTracks(). In testing, getConfiguration() alone is nearly 4kB with defaults, so this is a signficant chunk of the test limit of 7kB.

With this change, the max message size seen in tests was reduced from ~7kB to ~4kB, and the average message size was reduced from ~2kB to ~1kB. With this, we are lowering the thresholds in tests back to 6kB (max) and 2kB (average).

This also adds new versions of these message size tests for clear content. Although DRM content will generate larger messages, I had to do some of the work on this change while my internet connection was out, and I found it very useful to be able to run a version of these tests that did not require an internet connection (for a DRM license).

Our Cast API sends update messages from receiver to sender, and we
have observed before that there is a hidden limit on the size of those
messages.  A test was written long ago to catch unexpected increases
in message sizes, and it has recently started failing.

Our original limit on individual messages was set to 6kB, but later
raised to 7kB to silence test failures.  Our original goal was to keep
messages well under 8kB.  We also had a limit on the average message
size of 3kB (over 50 messages).

This change greatly reduces the sizes of individual messages by
splitting out updates to certain getters into their own messages.
These are the getters that produce the most data: getConfiguration(),
getStats(), getVariantTracks(), and getTextTracks().  In testing,
getConfiguration() alone is nearly 4kB with defaults, so this is a
signficant chunk of the test limit of 7kB.

With this change, the max message size seen in tests was reduced from
~7kB to ~4kB, and the average message size was reduced from ~2kB to
~1kB.  With this, we are lowering the thresholds in tests back to 6kB
(max) and 2kB (average).

This also adds new versions of these message size tests for clear
content.  Although DRM content will generate larger messages, I had to
do some of the work on this change while my internet connection was
out, and I found it very useful to be able to run a version of these
tests that did not require an internet connection (for a DRM license).
@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2022

Incremental code coverage: 100.00%

@avelad avelad added type: bug Something isn't working correctly platform: Cast Issues affecting Cast devices labels Nov 2, 2022
@avelad avelad added this to the v4.3 milestone Nov 2, 2022
@avelad avelad added the priority: P2 Smaller impact or easy workaround label Nov 2, 2022
@joeyparrish joeyparrish requested a review from avelad November 2, 2022 15:39
@joeyparrish joeyparrish merged commit 4e75ec6 into shaka-project:main Nov 2, 2022
@joeyparrish joeyparrish deleted the reduce-cast-message-size branch November 2, 2022 15:44
joeyparrish added a commit that referenced this pull request Nov 8, 2022
Our Cast API sends update messages from receiver to sender, and we have
observed before that there is a hidden limit on the size of those
messages. A test was written long ago to catch unexpected increases in
message sizes, and it has recently started failing.

Our original limit on individual messages was set to 6kB, but later
raised to 7kB to silence test failures. Our original goal was to keep
messages well under 8kB. We also had a limit on the average message size
of 3kB (over 50 messages).

This change greatly reduces the sizes of individual messages by
splitting out updates to certain getters into their own messages. These
are the getters that produce the most data: getConfiguration(),
getStats(), getVariantTracks(), and getTextTracks(). In testing,
getConfiguration() alone is nearly 4kB with defaults, so this is a
signficant chunk of the test limit of 7kB.

With this change, the max message size seen in tests was reduced from
~7kB to ~4kB, and the average message size was reduced from ~2kB to
~1kB. With this, we are lowering the thresholds in tests back to 6kB
(max) and 2kB (average).

This also adds new versions of these message size tests for clear
content. Although DRM content will generate larger messages, I had to do
some of the work on this change while my internet connection was out,
and I found it very useful to be able to run a version of these tests
that did not require an internet connection (for a DRM license).
joeyparrish added a commit that referenced this pull request Nov 8, 2022
Our Cast API sends update messages from receiver to sender, and we have
observed before that there is a hidden limit on the size of those
messages. A test was written long ago to catch unexpected increases in
message sizes, and it has recently started failing.

Our original limit on individual messages was set to 6kB, but later
raised to 7kB to silence test failures. Our original goal was to keep
messages well under 8kB. We also had a limit on the average message size
of 3kB (over 50 messages).

This change greatly reduces the sizes of individual messages by
splitting out updates to certain getters into their own messages. These
are the getters that produce the most data: getConfiguration(),
getStats(), getVariantTracks(), and getTextTracks(). In testing,
getConfiguration() alone is nearly 4kB with defaults, so this is a
signficant chunk of the test limit of 7kB.

With this change, the max message size seen in tests was reduced from
~7kB to ~4kB, and the average message size was reduced from ~2kB to
~1kB. With this, we are lowering the thresholds in tests back to 6kB
(max) and 2kB (average).

This also adds new versions of these message size tests for clear
content. Although DRM content will generate larger messages, I had to do
some of the work on this change while my internet connection was out,
and I found it very useful to be able to run a version of these tests
that did not require an internet connection (for a DRM license).
joeyparrish added a commit that referenced this pull request Nov 8, 2022
Our Cast API sends update messages from receiver to sender, and we have
observed before that there is a hidden limit on the size of those
messages. A test was written long ago to catch unexpected increases in
message sizes, and it has recently started failing.

Our original limit on individual messages was set to 6kB, but later
raised to 7kB to silence test failures. Our original goal was to keep
messages well under 8kB. We also had a limit on the average message size
of 3kB (over 50 messages).

This change greatly reduces the sizes of individual messages by
splitting out updates to certain getters into their own messages. These
are the getters that produce the most data: getConfiguration(),
getStats(), getVariantTracks(), and getTextTracks(). In testing,
getConfiguration() alone is nearly 4kB with defaults, so this is a
signficant chunk of the test limit of 7kB.

With this change, the max message size seen in tests was reduced from
~7kB to ~4kB, and the average message size was reduced from ~2kB to
~1kB. With this, we are lowering the thresholds in tests back to 6kB
(max) and 2kB (average).

This also adds new versions of these message size tests for clear
content. Although DRM content will generate larger messages, I had to do
some of the work on this change while my internet connection was out,
and I found it very useful to be able to run a version of these tests
that did not require an internet connection (for a DRM license).
joeyparrish added a commit that referenced this pull request Nov 8, 2022
Our Cast API sends update messages from receiver to sender, and we have
observed before that there is a hidden limit on the size of those
messages. A test was written long ago to catch unexpected increases in
message sizes, and it has recently started failing.

Our original limit on individual messages was set to 6kB, but later
raised to 7kB to silence test failures. Our original goal was to keep
messages well under 8kB. We also had a limit on the average message size
of 3kB (over 50 messages).

This change greatly reduces the sizes of individual messages by
splitting out updates to certain getters into their own messages. These
are the getters that produce the most data: getConfiguration(),
getStats(), getVariantTracks(), and getTextTracks(). In testing,
getConfiguration() alone is nearly 4kB with defaults, so this is a
signficant chunk of the test limit of 7kB.

With this change, the max message size seen in tests was reduced from
~7kB to ~4kB, and the average message size was reduced from ~2kB to
~1kB. With this, we are lowering the thresholds in tests back to 6kB
(max) and 2kB (average).

This also adds new versions of these message size tests for clear
content. Although DRM content will generate larger messages, I had to do
some of the work on this change while my internet connection was out,
and I found it very useful to be able to run a version of these tests
that did not require an internet connection (for a DRM license).
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform: Cast Issues affecting Cast devices priority: P2 Smaller impact or easy workaround status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants