Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
*: Support both Prost and rust-protobuf libraries #5379
To use Prost, set the
The most notable change is threading the prost-codec/protobuf-codec through the
We're using a Git dep for Prost in order to get some optimisations which are on
We must allow the
The changes to src/coprocessor/endpoint.rs are because Prost does not permit
What have you changed?
Add a feature flag for Prost which builds TiKV and its deps using Prost rather than rust-protobuf as the protobuf codec.
What is the type of the changes?
How is the PR tested?
Does this PR affect documentation (docs) or should it be mentioned in the release notes?
Should have dev docs (to come) and mentioned in release docs.
Does this PR affect
@@ Benchmark Diff @@ ================================================================================ tidb: 0f2434660c509ec0b493d8c7ee0bbbf8e8549184 --- tikv: ff82aa9eba331585aec1c6cdf9e1584512bccb34 +++ tikv: b294b71f9a4afd4ab1c47c2c452048d511954224 pd: c7c572a7dc9710aca57cb0bddf4d9bca6c4a111b ================================================================================ test-1: < oltp_insert > * QPS : 20840.65 ± 0.5553% (std=70.69) delta: -1.91% * AvgMs : 12.28 ± 0.5376% (std=0.04) delta: 1.93% * PercentileMs99 : 42.92 ± 1.0903% (std=0.38) delta: 0.73% test-2: < oltp_update_non_index > * QPS : 29243.96 ± 0.1096% (std=20.95) delta: -0.69% * AvgMs : 8.75 ± 0.1143% (std=0.01) delta: 0.71% * PercentileMs99 : 30.70 ± 2.1758% (std=0.41) delta: -0.35% test-3: < oltp_read_write > * QPS : 36624.11 ± 0.2892% (std=63.44) delta: -0.78% * AvgMs : 140.37 ± 0.2821% (std=0.25) delta: 0.79% * PercentileMs99 : 262.64 ± 0.0000% (std=0.00) delta: 1.82% test-4: < oltp_point_select > * QPS : 73650.82 ± 0.2890% (std=134.00) delta: -0.62% * AvgMs : 3.47 ± 1.0387% (std=0.02) delta: 0.35% * PercentileMs99 : 7.48 ± 1.0425% (std=0.06) delta: 0.00% test-5: < oltp_update_index > * QPS : 16519.31 ± 0.1599% (std=17.75) delta: -2.55% * AvgMs : 15.50 ± 0.1613% (std=0.02) delta: 2.62% * PercentileMs99 : 49.21 ± 0.0000% (std=0.00) delta: 1.80%
No because all the benches are inside the tests crate, so you must run
To use Prost, set the `PROST` env var, e.g.,: `PROST=1 make dev`. If using Cargo, use `--no-default-features --features prost-codec`. The most notable change is threading the prost-codec/protobuf-codec through the Cargo.tomls of all crates. In addition, in order to make this work I had to move integraton tests and benchmarks into their own crate (`tests`). This is because Cargo features do not interact perfectly with dev-dependencies. We're using a Git dep for Prost in order to get some optimisations which are on master, but not in the latest release. We can change to a crates.io dep when there is another release. We must allow the `identity_conversion` lint because there are some conversions which are meaningful with rust-protobuf, but no-ops with Prost. The changes to src/coprocessor/endpoint.rs are because Prost does not permit setting a custom recursion limit. We only did this for tests previously. We now use the default recursion limit all the time for both codecs; the test must be adjusted so that we hit the higher limit. Signed-off-by: Nick Cameron <email@example.com>