Skip to content

script: Guard brotli transport stream with feature flag - #47197

Merged
jdm merged 4 commits into
servo:mainfrom
Narfinger:brotli
Aug 12, 2026
Merged

jdm merged 4 commits into
servo:mainfrom
Narfinger:brotli

Conversation

@Narfinger

Copy link
Copy Markdown
Contributor

This guards brotli Transport Stream compression and decompression with a feature flag. If the feature flag is not enabled and transport stream is in brotli we throw a DOMException.

This saves roughly 1Mb in production-stripped binary.

Testing: The default is still to include brotli.
Fixes: #47190

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
@Narfinger
Narfinger requested a review from gterzian as a code owner August 12, 2026 12:13
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Aug 12, 2026
@Narfinger

Copy link
Copy Markdown
Contributor Author

Please check that this is how you should do domexception.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>

@jdm jdm left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm surprised the savings are so high for just two interfaces, since brotli is also used in the network stack.

Comment thread components/script/dom/stream/compressionstream.rs Outdated
Comment thread components/script/dom/stream/decompressionstream.rs Outdated
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Aug 12, 2026
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Aug 12, 2026
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
@Narfinger

Copy link
Copy Markdown
Contributor Author

Brotli encoding is pretty costly time wise (it was developed with that in mind), so the code size kind of makes sense. And my ls only shows increments of Mb, so it might be that it is rounding.

@jdm
jdm added this pull request to the merge queue Aug 12, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Aug 12, 2026
Merged via the queue into servo:main with commit 22b7b75 Aug 12, 2026
33 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Aug 12, 2026
@Narfinger
Narfinger deleted the brotli branch August 13, 2026 07:26
RichardTjokroutomo pushed a commit to RichardTjokroutomo/servo that referenced this pull request Oct 6, 2026
This guards brotli Transport Stream compression and decompression with a
feature flag. If the feature flag is not enabled and transport stream is
in brotli we throw a DOMException.

This saves roughly 1Mb in production-stripped binary.

Testing: The default is still to include brotli.
Fixes: servo#47190

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature guard (or remove) Compression stream brotli encoder

3 participants