In most of the cases, as we hope, RPCs shouldn't have errors.
But, in grpc_error_get_status() we treat GRPC_ERROR_NONE
similar to other errors, and waste quite a few cycles.
This patch is part of a larger performance improvements.
On client side, this particular code path accounts for 0.5%+.
Currently, we keep increasing the slice pointer, and
can run out of the inline space or try to realloc the
non-inline space unncessarily.
Simply set slices back to the start of the base_slices,
when we know the length of the slice_buffer is 0.
Note: This will change the behavior of undo_take_first(),
if user tries to grow the slie_buffer, between take_first()
and undo_take_first() calls. That said, it's not legal
to add something to the buffer in between take_first()
and undo_take_first(). So, we shouldn't have any issue.
More generic configuration system is introduced in order to i) unify the
way how modules access the configurations instead of using low-level
get/setenv functions and ii) enable the customization for where configuration
is stored. This could be extended to support flag, file, etc.
Default configuration system uses environment variables as before so
basically this is expected to work just as it did. This behavior can
change by redefining GPR_GLOBAL_CONFIG_DEFINE_*type* macros.
* Migrated configuration
GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS
GRPC_EXPERIMENTAL_DISABLE_FLOW_CONTROL
GRPC_ABORT_ON_LEAKS
GRPC_NOT_USE_SYSTEM_SSL_ROOTS
Compression is not used for performance senstiive RPCs, yet
chttp2 always moves buffers in/out of the compressed/decmpressed
buffers. Even initilizing them is costly.
Use the (de)compression buffer and state only when we are using
non-identity compression.
This is part of a larger performance change, and this one buys us 1%-2%
depending on the benchmark.
take_first(), grpc_undo_first(), ... are very clostly
methods that unnecessarily copy grpc_slice with extra
ref counting requirements.
Introduce alternatives to avoid copies and refs wherever
possible.
This results in 1% improvements in the benchmarks.