mirror of https://github.com/linkerd/linkerd2.git
During code review of another change I noticed that a lot of types seem to derive `Hash` (and `Eq`, `PartialEq`) even though the types should never (for performance reasons) be used as keys of a hash table, and where it is kind of questionable what equality should mean for those types. Then I noticed that similarly many types implement `Clone` even though I expect we should never be cloning them, again because of our performance goals. Because these types derive these traits, then whenever we add a field to them, that field also has to implement these traits. That means we then have to expand the problem, deriving implementations of these traits for types that don't otherwise want/need to implement these traits. This makes review complicated, because, for example, we have to decide whether something should be compared case-insensitively or case-sensitively when really we don't want to compare those things at all. To prove that we can get by by doing less, to speed up code review (particularly related to some stuff related to TLS), stop deriving `Clone`, `Eq`, `PartialEq`, and `Hash` for these types. I believe that, in particular, the change to key the Tap hash table based on request ID, instead of the whole request, should speed up the tap feature since we don't hash and/or compare every field, recursively, of requests. Later more such cleanup of this sort should be done. Signed-off-by: Brian Smith <brian@briansmith.org> |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
build.rs |