mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
dd1aaf90fe
Summary: This updates the AsyncRead implementations we use in hgproto and mercurial_bundles to use a LimitedAsyncRead. The upshot of this change is that we eliminate O(N^2) behavior when parsing the data we receive from clients. See the earlier diff on this stack for more detail on where this happens, but the bottom line is that Framed presents a full-size buffer that we zero out every time we try to read data. With this change, the buffer we zero out is comparable to the amount of data we are reading. This matters in commit cloud because bundles might be really big, and a single big bundle is enough to take an entire core for a spin or 20 minutes (and they achieve nothing but time out in the end). That being said, it's also useful for non-commit cloud bundles: we do occasionally receive big bundles (especially for WWW codemods), and those will benefit from the exact same speedup. One final thing I should mention: this is all in a busy CPU poll loop, and as I noted in my earlier diff, the effect persists across our bundle receiving code. This means it will sometimes result in not polling other futures we might have going. Reviewed By: farnz Differential Revision: D22432350 fbshipit-source-id: 33f1a035afb8cdae94c2ecb8e03204c394c67a55
30 lines
1003 B
TOML
30 lines
1003 B
TOML
[package]
|
|
name = "hgproto"
|
|
edition = "2018"
|
|
version = "0.1.0"
|
|
authors = ['Facebook']
|
|
license = "GPLv2+"
|
|
include = ["src/**/*.rs"]
|
|
|
|
[dependencies]
|
|
mercurial_bundles = { path = "../mercurial/bundles" }
|
|
mercurial_types = { path = "../mercurial/types" }
|
|
mononoke_types = { path = "../mononoke_types" }
|
|
failure_ext = { git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
|
|
futures_ext = { git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
|
|
limited_async_read = { git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
|
|
anyhow = "1.0"
|
|
bytes-old = { package = "bytes", version = "0.4", features = ["serde"] }
|
|
futures = "0.1"
|
|
hex = "0.4"
|
|
itertools = "0.8"
|
|
nom = { version = "3", features = [ "verbose-errors" ] }
|
|
slog = { version = "2.5", features = ["max_level_debug"] }
|
|
thiserror = "1.0"
|
|
tokio-io = "0.1"
|
|
|
|
[dev-dependencies]
|
|
mercurial_types-mocks = { path = "../mercurial/types/mocks" }
|
|
maplit = "1.0"
|
|
quickcheck = "0.9"
|