Skip to main content

compression_stream_ctor

Function compression_stream_ctor 

Source
pub(crate) fn compression_stream_ctor(
    it: &mut Interp,
    this: Value,
    a: &[Value],
) -> Result<Value, Value>
Expand description

CompressionStream コンストラクタ (new CompressionStream(format)。gzip・deflate・deflate-raw)。

【2026-10-27】YouTube の player はログ送信の本文を、CompressionStream があればそれで、無ければ JS 版 zlib(pako 相当)で gzip 圧縮する(typeof CompressionStream !== "undefined" で判定)。JS 版は インタプリタでは非常に重く、区間によって JS 時間の約 3 割を占めていたので、ネイティブで圧縮する。 この処理系のストリームは同期的なので、書き込まれた塊は writable を閉じたときにまとめて圧縮し、 結果を readable へ 1 つの Uint8Array として流して閉じる。