Skip to content

Update hashbrown and transitive dependencies. #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 4, 2020

Conversation

PiotrSikora
Copy link
Member

Signed-off-by: Piotr Sikora piotrsikora@google.com

Signed-off-by: Piotr Sikora <piotrsikora@google.com>
@PiotrSikora PiotrSikora requested a review from gbrail November 4, 2020 00:57
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
Copy link
Contributor

@gbrail gbrail left a comment

Choose a reason for hiding this comment

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

This looks fine. However, do we still need hashbrown? Apparently the only reason one needs it today is to work in a "no_std" environment. Can this SDK work in such an environment?

@PiotrSikora
Copy link
Member Author

This looks fine. However, do we still need hashbrown? Apparently the only reason one needs it today is to work in a "no_std" environment. Can this SDK work in such an environment?

While std::HashMap implementation was updated to hashbrown::HashMap in Rust 1.36, it uses HashDoS-resistant SipHash, whereas hashbrown uses not HashDoS-resistant AHash, which is significantly faster.

Regarding no_std, I never tested it, but I suppose it should work.

@PiotrSikora PiotrSikora merged commit 3aad1be into proxy-wasm:master Nov 4, 2020
nullpo-head pushed a commit to nullpo-head/proxy-wasm-rust-sdk that referenced this pull request Mar 2, 2021
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
yskopets added a commit to yskopets/proxy-wasm-rust-sdk that referenced this pull request Mar 2, 2021
* Use Rust toolchains with working components. (#16)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Split licenses check into a separate test target. (#17)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Help other developers get started using this SDK. (#15)

Signed-off-by: DazWilkin <daz.wilkin@gmail.com>

* Add Bazel support. (#18)

Signed-off-by: Shikugawa <Shikugawa@gmail.com>
Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add support for setting HTTP bodies. (#2)

Signed-off-by: Gregory Brail <gregbrail@google.com>

* Release v0.1.1. (#20)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update MapType values to match updated Proxy-Wasm ABI v0.1.0. (#7)

Signed-off-by: Yaroslav Skopets <yaroslav@tetrate.io>

* Release v0.1.2. (#21)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update hashbrown to v0.8.2. (#22)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add cargo audit and cargo outdated checks. (#23)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update chrono to v0.4.15. (proxy-wasm#33)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Move optional checks to the end. (proxy-wasm#28)

While there, align style with the test framework.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Move Bazel to //bazel. (proxy-wasm#29)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Fix HTTP body example. (proxy-wasm#32)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add support for setting network buffers. (proxy-wasm#31)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add metrics. (proxy-wasm#30)

Fixes #4.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update hashbrown and transitive dependencies. (proxy-wasm#45)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Allow building for wasm32-wasi target. (proxy-wasm#42)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Make wee-alloc an optional feature. (proxy-wasm#38)

Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>

* Update rules_rust to latest. (proxy-wasm#46)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update cargo-raze to latest and regenerate artifacts. (proxy-wasm#47)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Allow building for wasm32-wasi target using Bazel. (proxy-wasm#50)

While there, update Bazel to 3.7.0.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Show getrandom and chrono/time usage in examples. (proxy-wasm#51)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Use cargo-raze's gen_buildrs for trusted crates. (proxy-wasm#53)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add support for nested HTTP callouts. (proxy-wasm#56)

Signed-off-by: Svetlin Zarev <svetlin.zarev@sap.com>

* Allow RootContext to create child contexts for streams. (proxy-wasm#34)

Fixes #6.

Signed-off-by: Daniel Grimm <dgrimm@redhat.com>

* Fix warnings from Clippy v1.50.0 (nightly). (proxy-wasm#58)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Release v0.1.3. (proxy-wasm#59)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Cleanup instructions for updating dependencies. (proxy-wasm#60)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Cleanup WORKSPACE. (proxy-wasm#61)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Cleanup examples. (proxy-wasm#62)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update libc (transitive dependency) to v0.2.81. (proxy-wasm#63)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update the declared ABI version to 0.2.0

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Update the examples so that they use the latest API

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Remove ChildContext for now, which is not used anymore

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Bump the version to 0.0.8

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Fix bazel build for the fork's crate

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Fix clippy erros in bytestring.rs

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Update dependencies

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Fix Cargo.toml

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* outdated should check only root deps

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Fix inconsistent derived traits

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

Co-authored-by: Piotr Sikora <piotrsikora@google.com>
Co-authored-by: Daz Wilkin <DazWilkin@users.noreply.github.com>
Co-authored-by: Greg Brail <gbrail@users.noreply.github.com>
Co-authored-by: Yaroslav Skopets <y.skopets@gmail.com>
Co-authored-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Co-authored-by: SvetlinZarev-SAP <43135961+SvetlinZarev-SAP@users.noreply.github.com>
Co-authored-by: Daniel Grimm <dgrimm@redhat.com>
github-actions bot pushed a commit to yskopets/proxy-wasm-rust-sdk that referenced this pull request Mar 2, 2021
* Use Rust toolchains with working components. (#16)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Split licenses check into a separate test target. (#17)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Help other developers get started using this SDK. (#15)

Signed-off-by: DazWilkin <daz.wilkin@gmail.com>

* Add Bazel support. (#18)

Signed-off-by: Shikugawa <Shikugawa@gmail.com>
Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add support for setting HTTP bodies. (#2)

Signed-off-by: Gregory Brail <gregbrail@google.com>

* Release v0.1.1. (#20)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update MapType values to match updated Proxy-Wasm ABI v0.1.0. (#7)

Signed-off-by: Yaroslav Skopets <yaroslav@tetrate.io>

* Release v0.1.2. (#21)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update hashbrown to v0.8.2. (#22)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add cargo audit and cargo outdated checks. (#23)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update chrono to v0.4.15. (proxy-wasm#33)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Move optional checks to the end. (proxy-wasm#28)

While there, align style with the test framework.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Move Bazel to //bazel. (proxy-wasm#29)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Fix HTTP body example. (proxy-wasm#32)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add support for setting network buffers. (proxy-wasm#31)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add metrics. (proxy-wasm#30)

Fixes #4.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update hashbrown and transitive dependencies. (proxy-wasm#45)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Allow building for wasm32-wasi target. (proxy-wasm#42)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Make wee-alloc an optional feature. (proxy-wasm#38)

Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>

* Update rules_rust to latest. (proxy-wasm#46)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update cargo-raze to latest and regenerate artifacts. (proxy-wasm#47)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Allow building for wasm32-wasi target using Bazel. (proxy-wasm#50)

While there, update Bazel to 3.7.0.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Show getrandom and chrono/time usage in examples. (proxy-wasm#51)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Use cargo-raze's gen_buildrs for trusted crates. (proxy-wasm#53)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add support for nested HTTP callouts. (proxy-wasm#56)

Signed-off-by: Svetlin Zarev <svetlin.zarev@sap.com>

* Allow RootContext to create child contexts for streams. (proxy-wasm#34)

Fixes #6.

Signed-off-by: Daniel Grimm <dgrimm@redhat.com>

* Fix warnings from Clippy v1.50.0 (nightly). (proxy-wasm#58)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Release v0.1.3. (proxy-wasm#59)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Cleanup instructions for updating dependencies. (proxy-wasm#60)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Cleanup WORKSPACE. (proxy-wasm#61)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Cleanup examples. (proxy-wasm#62)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update libc (transitive dependency) to v0.2.81. (proxy-wasm#63)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update the declared ABI version to 0.2.0

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Update the examples so that they use the latest API

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Remove ChildContext for now, which is not used anymore

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Bump the version to 0.0.8

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Fix bazel build for the fork's crate

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Fix clippy erros in bytestring.rs

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Update dependencies

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Fix Cargo.toml

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* outdated should check only root deps

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Fix inconsistent derived traits

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

Co-authored-by: Piotr Sikora <piotrsikora@google.com>
Co-authored-by: Daz Wilkin <DazWilkin@users.noreply.github.com>
Co-authored-by: Greg Brail <gbrail@users.noreply.github.com>
Co-authored-by: Yaroslav Skopets <y.skopets@gmail.com>
Co-authored-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Co-authored-by: SvetlinZarev-SAP <43135961+SvetlinZarev-SAP@users.noreply.github.com>
Co-authored-by: Daniel Grimm <dgrimm@redhat.com>
@codefromthecrypt
Copy link

I think we should remove hashbrown as it is a large source of maintenance and contributes to slow compilation. It is odd post 1.36 for us to optimize so specifically. If we did, we should have some benchmarks to show why this is so essential.

@PiotrSikora
Copy link
Member Author

I think we should remove hashbrown as it is a large source of maintenance

According to whom? Based on what? It requires virtually zero maintenance.

and contributes to slow compilation.

Do you have any numbers?

It is odd post 1.36 for us to optimize so specifically. If we did, we should have some benchmarks to show why this is so essential.

There are benchmarks in https://github.com/rust-lang/hashbrown that show that insert and erase are 2x faster, and lookup is 3x faster when using AHash instead of SipHash.

@codefromthecrypt
Copy link

https://github.com/proxy-wasm/proxy-wasm-rust-sdk/search?q=hashbrown is all for a single line of code which swaps out the normal map for the hashbrown one

hashbrown plus its dep ahash inside getenvoy's matrix tests take a second to compile * all tests that use it. It is actually hard to measure if there are any other knock-on effects without removing it first (ex resulting size of wasm)

I think benchmarking should be relevant, for example the resulting wasm execution speed if that's really the reason here.

@PiotrSikora
Copy link
Member Author

https://github.com/proxy-wasm/proxy-wasm-rust-sdk/search?q=hashbrown is all for a single line of code which swaps out the normal map for the hashbrown one

Sorry, but what are you trying to prove here? It's a drop-in replacement and it literally couldn't require any less work.

For Cargo builds, you only need to declare hashbrown dependency in Cargo.toml and use it in src/dispatcher.rs.

All other files in your link are autogenerated Bazel rules. Are you suggesting that we remove support for Bazel? It's actually a huge source of maintenance, and most of the commits in this repo are only bumping depenencies in Bazel rules, which we stopped doing recently (See: #99).

hashbrown plus its dep ahash inside getenvoy's matrix tests take a second to compile * all tests that use it. It is actually hard to measure if there are any other knock-on effects without removing it first (ex resulting size of wasm)

If you're looking to fix slow times of Envoy builds/tests, then you're barking at the wrong tree.

I think benchmarking should be relevant, for example the resulting wasm execution speed if that's really the reason here.

I did exactly that in the past, which is why we're using it as a dependency.

@codefromthecrypt
Copy link

To step back, I didn't intend to start trouble. I am literally trying to champion use of your copy of proxy-wasm-rust-sdk. There is currently version skew in the fork vs here in hashbrown. I was surprised to see it in use, found someone else asked, so figured I would bring some experience here. That literally go vs rust for wasm, the latter is slow to compile especially on macos and even worse inside a build container. I don't expect to prove that to you, you can accept it or not.

The other thing I ran into was maintenance you rightly put as bazel related, but also a large amount of things just to maintain hashbrown. Indeed that can go away with Bazel, and good riddance if it does.

Core libraries should make speed packs optional not required, as doing so eliminates discussions like this one. I don't expect to change your mind or prove anything, but I did feel like it needed to be said.

Please deep breath on this one.. personally benchmarking a point in time is a "trust me" type of thing. If you really want to champion this it is probably best to put in a target here that benchmarks the resultant wasm. that's more show vs tell, and I don't expect you to do this, but it should be said.

@PiotrSikora
Copy link
Member Author

Don't you see the irony in the fact that you're requesting benchmark targets to prove that hashbrown::HashMap with AHash is faster than the default HashMap (even though those already exist in the official repo), while at the same time claiming some (IMHO, unfounded) issues without any data to back them up, and saying that you "don't expect to prove them"?

But to end this discussion:

  1. There is virtually zero maintanence burden because of hashbrown, and even if there was, it's all on me.
  2. If using hashbrown::HashMap with AHash instead of the default HashMap results in a slow compilation, then that's unfortunate, but I'll take slow compilation over slow runtime performance every single time (note: the source of slow compilation is probably the inline-more feature in hashbrown).
  3. Since hashbrown is used, the onus is you to prove that removing it doesn't degrade the performance.

github-actions bot pushed a commit to nullpo-head/proxy-wasm-rust-sdk that referenced this pull request Apr 20, 2021
…opets#19)

* Use Rust toolchains with working components. (yskopets#16)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Split licenses check into a separate test target. (yskopets#17)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Help other developers get started using this SDK. (yskopets#15)

Signed-off-by: DazWilkin <daz.wilkin@gmail.com>

* Add Bazel support. (yskopets#18)

Signed-off-by: Shikugawa <Shikugawa@gmail.com>
Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add support for setting HTTP bodies. (yskopets#2)

Signed-off-by: Gregory Brail <gregbrail@google.com>

* Release v0.1.1. (yskopets#20)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update MapType values to match updated Proxy-Wasm ABI v0.1.0. (yskopets#7)

Signed-off-by: Yaroslav Skopets <yaroslav@tetrate.io>

* Release v0.1.2. (yskopets#21)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update hashbrown to v0.8.2. (yskopets#22)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add cargo audit and cargo outdated checks. (yskopets#23)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update chrono to v0.4.15. (proxy-wasm#33)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Move optional checks to the end. (proxy-wasm#28)

While there, align style with the test framework.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Move Bazel to //bazel. (proxy-wasm#29)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Fix HTTP body example. (proxy-wasm#32)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add support for setting network buffers. (proxy-wasm#31)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add metrics. (proxy-wasm#30)

Fixes yskopets#4.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update hashbrown and transitive dependencies. (proxy-wasm#45)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Allow building for wasm32-wasi target. (proxy-wasm#42)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Make wee-alloc an optional feature. (proxy-wasm#38)

Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>

* Update rules_rust to latest. (proxy-wasm#46)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update cargo-raze to latest and regenerate artifacts. (proxy-wasm#47)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Allow building for wasm32-wasi target using Bazel. (proxy-wasm#50)

While there, update Bazel to 3.7.0.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Show getrandom and chrono/time usage in examples. (proxy-wasm#51)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Use cargo-raze's gen_buildrs for trusted crates. (proxy-wasm#53)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add support for nested HTTP callouts. (proxy-wasm#56)

Signed-off-by: Svetlin Zarev <svetlin.zarev@sap.com>

* Allow RootContext to create child contexts for streams. (proxy-wasm#34)

Fixes yskopets#6.

Signed-off-by: Daniel Grimm <dgrimm@redhat.com>

* Fix warnings from Clippy v1.50.0 (nightly). (proxy-wasm#58)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Release v0.1.3. (proxy-wasm#59)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Cleanup instructions for updating dependencies. (proxy-wasm#60)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Cleanup WORKSPACE. (proxy-wasm#61)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Cleanup examples. (proxy-wasm#62)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update libc (transitive dependency) to v0.2.81. (proxy-wasm#63)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update the declared ABI version to 0.2.0

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Update the examples so that they use the latest API

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Remove ChildContext for now, which is not used anymore

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Bump the version to 0.0.8

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Fix bazel build for the fork's crate

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Fix clippy erros in bytestring.rs

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Update dependencies

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Fix Cargo.toml

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* outdated should check only root deps

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Fix inconsistent derived traits

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

Co-authored-by: Piotr Sikora <piotrsikora@google.com>
Co-authored-by: Daz Wilkin <DazWilkin@users.noreply.github.com>
Co-authored-by: Greg Brail <gbrail@users.noreply.github.com>
Co-authored-by: Yaroslav Skopets <y.skopets@gmail.com>
Co-authored-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Co-authored-by: SvetlinZarev-SAP <43135961+SvetlinZarev-SAP@users.noreply.github.com>
Co-authored-by: Daniel Grimm <dgrimm@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants