servo: Merge #12050 - Switch to a faster Brotli crate (from johannhof:brotli); r=jdm
authorJohann Hofmann <mail@johann-hofmann.com>
Sun, 03 Jul 2016 18:32:15 -0700
changeset 339194 46615d92583f67738218607fa0e0292211605dd3
parent 339193 8fd2dbdc95ce5aa51937164f3e37e4f6d8dfa917
child 339195 bbefb3e62a926cfc6b4fddc6441b91d7d695d39c
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
servo: Merge #12050 - Switch to a faster Brotli crate (from johannhof:brotli); r=jdm <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #11933. <!-- Either: --> - [x] These changes do not require tests (I hope) because no new behavior was introduced <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: c8b048e368d4f9de08011b89e530ba9075e08ec3
servo/components/net/Cargo.toml
servo/components/net/http_loader.rs
servo/components/servo/Cargo.lock
servo/ports/cef/Cargo.lock
--- a/servo/components/net/Cargo.toml
+++ b/servo/components/net/Cargo.toml
@@ -5,17 +5,17 @@ authors = ["The Servo Project Developers
 publish = false
 
 [lib]
 name = "net"
 path = "lib.rs"
 
 [dependencies]
 bitflags = "0.7"
-brotli = {git = "https://github.com/ende76/brotli-rs"}
+brotli = "1.0.6"
 content-blocker = "0.2"
 cookie = { version = "0.2.5", features = ["serialize-serde", "serialize-rustc" ] }
 device = {git = "https://github.com/servo/devices"}
 devtools_traits = {path = "../devtools_traits"}
 flate2 = "0.2.0"
 hyper = {version = "0.9.9", features = ["serde-serialization"]}
 immeta = "0.3.1"
 ipc-channel = {git = "https://github.com/servo/ipc-channel"}
--- a/servo/components/net/http_loader.rs
+++ b/servo/components/net/http_loader.rs
@@ -565,17 +565,17 @@ impl StreamedResponse {
                             LoadError::new(m.final_url, LoadErrorType::Decoding { reason: err.to_string() }))
                     }
                 }
             }
             Some(Encoding::Deflate) => {
                 Decoder::Deflate(DeflateDecoder::new(response))
             }
             Some(Encoding::EncodingExt(ref ext)) if ext == "br" => {
-                Decoder::Brotli(Decompressor::new(response))
+                Decoder::Brotli(Decompressor::new(response, 1024))
             }
             _ => {
                 Decoder::Plain(response)
             }
         };
         Ok(StreamedResponse::new(m, decoder))
     }
 }
--- a/servo/components/servo/Cargo.lock
+++ b/servo/components/servo/Cargo.lock
@@ -53,16 +53,21 @@ dependencies = [
 name = "aho-corasick"
 version = "0.5.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
+name = "alloc-no-stdlib"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
 name = "android_glue"
 version = "0.1.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "angle"
 version = "0.1.0"
 source = "git+https://github.com/servo/angle?branch=servo#d0a2db05d1ada8e38b0143a5846f68089f332e9e"
@@ -179,18 +184,21 @@ version = "0.1.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "dbus 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "brotli"
-version = "0.3.23"
-source = "git+https://github.com/ende76/brotli-rs#d8507fd07e9fa57ed8251d5dc500dcd62df62c7c"
+version = "1.0.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "alloc-no-stdlib 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
 
 [[package]]
 name = "browserhtml"
 version = "0.1.14"
 source = "git+https://github.com/browserhtml/browserhtml?branch=gh-pages#aa577e5d9f436f98b4bd80424a8e48e43f370c43"
 
 [[package]]
 name = "byteorder"
@@ -1386,17 +1394,17 @@ dependencies = [
  "webrender_traits 0.2.0 (git+https://github.com/servo/webrender_traits)",
 ]
 
 [[package]]
 name = "net"
 version = "0.0.1"
 dependencies = [
  "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "brotli 0.3.23 (git+https://github.com/ende76/brotli-rs)",
+ "brotli 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "content-blocker 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "device 0.0.1 (git+https://github.com/servo/devices)",
  "devtools_traits 0.0.1",
  "flate2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
  "hyper 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
  "immeta 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)",
--- a/servo/ports/cef/Cargo.lock
+++ b/servo/ports/cef/Cargo.lock
@@ -27,16 +27,21 @@ dependencies = [
 name = "aho-corasick"
 version = "0.5.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
+name = "alloc-no-stdlib"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
 name = "android_glue"
 version = "0.1.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "angle"
 version = "0.1.0"
 source = "git+https://github.com/servo/angle?branch=servo#d0a2db05d1ada8e38b0143a5846f68089f332e9e"
@@ -153,18 +158,21 @@ version = "0.1.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "dbus 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "brotli"
-version = "0.3.23"
-source = "git+https://github.com/ende76/brotli-rs#d8507fd07e9fa57ed8251d5dc500dcd62df62c7c"
+version = "1.0.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "alloc-no-stdlib 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
 
 [[package]]
 name = "browserhtml"
 version = "0.1.14"
 source = "git+https://github.com/browserhtml/browserhtml?branch=gh-pages#aa577e5d9f436f98b4bd80424a8e48e43f370c43"
 
 [[package]]
 name = "byteorder"
@@ -1288,17 +1296,17 @@ dependencies = [
  "webrender_traits 0.2.0 (git+https://github.com/servo/webrender_traits)",
 ]
 
 [[package]]
 name = "net"
 version = "0.0.1"
 dependencies = [
  "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "brotli 0.3.23 (git+https://github.com/ende76/brotli-rs)",
+ "brotli 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "content-blocker 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "device 0.0.1 (git+https://github.com/servo/devices)",
  "devtools_traits 0.0.1",
  "flate2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
  "hyper 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
  "immeta 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)",