grpc-java/census
Justin Bassett 1241946c15 Always update the TagContext in filterContext()
This is a potential optimization, depending on the OpenCensus
implementation installed. Currently, the code checks TagContext equality
against the empty TagContext as an optimization to avoid updating the
Context, but checking equality may not be cheaper than updating the
Context. In particular, this condition is almost always true, because we
[update the parentCtx with an additional
tag](bacf18db8d/census/src/main/java/io/grpc/census/CensusStatsModule.java (L770-L774)).
It's only true when there is no OpenCensus implementation (i.e. some
kind of no-op implementation that ignores TagContexts) or when the empty
TagContext already has that tag set to the specific value which varies
depending on the RPC method.

For the default OpenCensus implementation, the equality check is
equality between two maps. Other implementations may require additional
work to determine equality.

Basically, we are trading off rarely avoiding updating the Context for
always doing at least a map equality or potentially even more depending
on the OpenCensus implementation in use. Given this, it makes sense to
just always update the Context.
2022-11-17 10:22:43 -08:00
..
src Always update the TagContext in filterContext() 2022-11-17 10:22:43 -08:00
BUILD.bazel core, census, testing, interop-testing, android-interop-testing: move census dependency out of grpc-core (#6577) 2020-01-13 14:35:29 -08:00
build.gradle Swap Animalsniffer to Java 8 and Android 19 2022-08-10 12:41:57 -07:00