Skip to content

Remove memset(0) from arena allocate memory.#16944

Merged
soheilhy merged 1 commit intogrpc:masterfrom
soheilhy:worktree-memset
Nov 5, 2018
Merged

Remove memset(0) from arena allocate memory.#16944
soheilhy merged 1 commit intogrpc:masterfrom
soheilhy:worktree-memset

Conversation

@soheilhy
Copy link
Copy Markdown
Contributor

@soheilhy soheilhy commented Oct 19, 2018

Callers should properly initialize the memory.

Note that to avoid performance regressions we need some
reordering in the initialization of grpc_call.

This behavior can be overridden using GRPC_ARENA_INIT_STRATEGY
environment variable.

I had two more changes in the following files which I will skip in the
PR because they are purely performance changes for cache
coherency. I will upload that as a separate patch once this PR
is merged:
src/core/lib/channel/channel_stack.cc
src/core/lib/surface/call.cc


This change is Reviewable

@grpc-testing
Copy link
Copy Markdown

****************************************************************

libgrpc.so

     VM SIZE                                                                                            FILE SIZE
 ++++++++++++++ GROWING                                                                              ++++++++++++++
  +2.6%    +848 src/core/ext/transport/chttp2/transport/chttp2_transport.cc                             +848  +2.6%
      +133%    +613 init_stream                                                                             +613  +133%
      +4.1%    +144 grpc_create_chttp2_transport                                                            +144  +4.1%
      +3.7%     +16 write_action_end_locked                                                                  +16  +3.7%
      +0.5%     +16 perform_stream_op_locked                                                                 +16  +0.5%
      +3.2%     +16 write_action_begin_locked                                                                +16  +3.2%
      +7.5%     +11 grpc_chttp2_initiate_write                                                               +11  +7.5%
       +16%     +11 write_action                                                                             +11   +16%
      +7.6%     +11 perform_transport_op                                                                     +11  +7.6%
       +20%     +11 grpc_core::Chttp2IncomingByteStream::Orphan                                              +11   +20%
      +6.7%      +8 destroy_stream                                                                            +8  +6.7%
      +9.4%      +8 destroy_transport                                                                         +8  +9.4%
      +2.4%      +8 perform_stream_op                                                                         +8  +2.4%
      +7.9%      +8 grpc_core::Chttp2IncomingByteStream::Next                                                 +8  +7.9%
  +5.3%    +848 src/core/lib/surface/call.cc                                                            +848  +5.3%
       +31%    +600 grpc_call_create                                                                        +600   +31%
      +6.9%    +236 call_start_batch                                                                        +236  +6.9%
      +7.2%     +16 cancel_with_error                                                                        +16  +7.2%
      +3.3%     +16 receiving_stream_ready                                                                   +16  +3.3%
      +1.0%     +16 receiving_initial_metadata_ready                                                         +16  +1.0%
      +2.3%      +8 destroy_call                                                                              +8  +2.3%
  +0.7%    +744 [Other]                                                                                 +744  +0.7%
  +2.0%    +736 src/core/ext/filters/client_channel/client_channel.cc                                   +736  +2.0%
      +132%    +356 cc_init_call_elem                                                                       +356  +132%
      +1.3%     +48 start_retriable_subchannel_batches                                                       +48  +1.3%
      +5.4%     +48 pick_done                                                                                +48  +5.4%
      +6.1%     +32 cc_destroy_channel_elem                                                                  +32  +6.1%
      +0.8%     +32 on_resolver_result_changed_locked                                                        +32  +0.8%
      +2.7%     +32 process_service_config_and_start_lb_pick_locked                                          +32  +2.7%
       +15%     +25 batch_data_create                                                                        +25   +15%
      +1.1%     +24 run_closures_for_completed_call                                                          +24  +1.1%
      +9.4%     +16 [Other]                                                                                  +16  +9.4%
      +1.2%     +16 cc_init_channel_elem                                                                     +16  +1.2%
      +1.2%     +16 pending_batches_fail                                                                     +16  +1.2%
       +10%     +16 cc_start_transport_op                                                                    +16   +10%
      +1.5%     +16 pending_batches_resume                                                                   +16  +1.5%
      +0.7%     +11 maybe_retry                                                                              +11  +0.7%
      +9.6%     +11 pick_done_locked                                                                         +11  +9.6%
      +4.8%     +11 start_internal_recv_trailing_metadata                                                    +11  +4.8%
      +6.6%      +8 grpc_client_channel_check_connectivity_state                                              +8  +6.6%
      +4.9%      +8 grpc_client_channel_watch_connectivity_state                                              +8  +4.9%
      +1.2%      +8 start_pick_locked                                                                         +8  +1.2%
      +6.9%      +8 watch_lb_policy_locked                                                                    +8  +6.9%
      +2.1%      +8 add_closure_for_subchannel_batch(grpc_call_element*, grpc_transport_stream_op_batch*      +8  +2.1%
  +1.0%    +160 src/core/lib/surface/server.cc                                                          +160  +1.0%
      +4.1%     +24 publish_new_rpc                                                                          +24  +4.1%
       +11%     +22 init_call_elem                                                                           +22   +11%
      +6.6%     +19 finish_start_new_rpc                                                                     +19  +6.6%
      +5.1%     +17 accept_stream                                                                            +17  +5.1%
      +4.7%     +16 [Unmapped]                                                                               +16  +4.7%
      +2.4%     +16 grpc_server_request_registered_call                                                      +16  +2.4%
      +2.3%     +11 queue_call_request                                                                       +11  +2.3%
      +8.1%     +11 request_matcher_zombify_all_pending_calls((anonymous namespace)::request_matcher*) [     +11  +8.1%
      +3.9%      +8 init_channel_elem                                                                         +8  +3.9%
      +0.9%      +8 grpc_server_shutdown_and_notify                                                           +8  +0.9%
      +1.4%      +8 grpc_server_start                                                                         +8  +1.4%
  +4.7%    +152 src/core/lib/security/transport/client_auth_filter.cc                                   +152  +4.7%
       +84%    +113 init_call_elem                                                                          +113   +84%
      +4.0%     +24 auth_start_transport_stream_op_batch                                                     +24  +4.0%
      +2.0%     +16 on_host_checked                                                                          +16  +2.0%
  +2.7%    +144 src/core/ext/filters/http/client/http_client_filter.cc                                  +144  +2.7%
      +102%    +139 init_call_elem                                                                          +139  +102%
      +6.8%      +5 [Unmapped]                                                                                +5  +6.8%
  +3.2%    +144 src/core/ext/filters/http/server/http_server_filter.cc                                  +144  +3.2%
      +128%    +138 hs_init_call_elem                                                                       +138  +128%
      +6.8%      +6 [Unmapped]                                                                                +6  +6.8%
  +5.4%    +144 src/core/lib/security/transport/server_auth_filter.cc                                   +144  +5.4%
      +103%    +146 init_call_elem                                                                          +146  +103%
      +1.1%      +8 recv_initial_metadata_ready                                                               +8  +1.1%
  +0.8%    +128 src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc                          +128  +0.8%
      +3.2%     +33 grpc_core::(anonymous namespace)::GrpcLbFactory::CreateLoadBalancingPolicy(grpc_core     +33  +3.2%
      +2.0%     +32 grpc_core::(anonymous namespace)::GrpcLb::StartBalancerCallLocked                        +32  +2.0%
      +0.9%     +16 grpc_core::(anonymous namespace)::GrpcLb::CreateOrUpdateRoundRobinPolicyLocked() [cl     +16  +0.9%
      +4.3%     +16 grpc_core::(anonymous namespace)::GrpcLb::~GrpcLb                                        +16  +4.3%
      +9.2%     +11 grpc_core::(anonymous namespace)::GrpcLb::BalancerCallState::ScheduleNextClientLoadR     +11  +9.2%
      +6.1%     +11 grpc_core::(anonymous namespace)::GrpcLb::StartPickingLocked                             +11  +6.1%
      +2.6%      +8 grpc_core::(anonymous namespace)::GrpcLb::PickLocked                                      +8  +2.6%
      +1.4%      +8 grpc_core::(anonymous namespace)::GrpcLb::BalancerCallState::SendClientLoadReportLoc      +8  +1.4%
  +0.8%    +128 src/core/ext/filters/client_channel/lb_policy/xds/xds.cc                                +128  +0.8%
      +3.2%     +33 grpc_core::(anonymous namespace)::XdsFactory::CreateLoadBalancingPolicy(grpc_core::L     +33  +3.2%
      +2.0%     +32 grpc_core::(anonymous namespace)::XdsLb::StartBalancerCallLocked                         +32  +2.0%
      +0.9%     +16 grpc_core::(anonymous namespace)::XdsLb::CreateOrUpdateRoundRobinPolicyLocked() [clo     +16  +0.9%
      +4.3%     +16 grpc_core::(anonymous namespace)::XdsLb::~XdsLb                                          +16  +4.3%
      +9.2%     +11 grpc_core::(anonymous namespace)::XdsLb::BalancerCallState::ScheduleNextClientLoadRe     +11  +9.2%
      +6.1%     +11 grpc_core::(anonymous namespace)::XdsLb::StartPickingLocked                              +11  +6.1%
      +2.6%      +8 grpc_core::(anonymous namespace)::XdsLb::PickLocked                                       +8  +2.6%
      +1.4%      +8 grpc_core::(anonymous namespace)::XdsLb::BalancerCallState::SendClientLoadReportLock      +8  +1.4%
  +1.2%     +96 src/core/ext/filters/client_channel/subchannel.cc                                        +96  +1.2%
      +7.0%     +18 [Unmapped]                                                                               +18  +7.0%
      +1.1%     +16 grpc_subchannel_create                                                                   +16  +1.1%
      +5.0%     +16 grpc_core::ConnectedSubchannel::CreateCall                                               +16  +5.0%
      +4.0%     +14 maybe_start_connecting_locked                                                            +14  +4.0%
      +8.0%      +8 grpc_subchannel_weak_unref                                                                +8  +8.0%
      +3.7%      +8 grpc_subchannel_call_process_op                                                           +8  +3.7%
      +2.8%      +8 grpc_subchannel_notify_on_state_change                                                    +8  +2.8%
      +0.8%      +8 on_subchannel_connected                                                                   +8  +0.8%
  +0.6%     +96 src/core/ext/transport/inproc/inproc_transport.cc                                        +96  +0.6%
      +8.3%     +80 init_stream                                                                              +80  +8.3%
      +0.6%     +16 perform_stream_op                                                                        +16  +0.6%
  +3.7%     +80 src/core/ext/filters/deadline/deadline_filter.cc                                         +80  +3.7%
       +28%     +32 grpc_deadline_state_init                                                                 +32   +28%
      +6.5%     +16 server_start_transport_stream_op_batch                                                   +16  +6.5%
      +7.7%      +8 grpc_deadline_state_client_start_transport_stream_op_batch                                +8  +7.7%
      +3.0%      +8 timer_callback                                                                            +8  +3.0%
      +3.2%      +8 start_timer_if_needed(grpc_call_element*, long) [clone .part.2]                           +8  +3.2%
      +6.7%      +8 send_cancel_op_in_call_combiner                                                           +8  +6.7%
  +2.8%     +80 src/core/ext/filters/max_age/max_age_filter.cc                                           +80  +2.8%
      +8.9%     +72 init_channel_elem                                                                        +72  +8.9%
      +5.9%      +8 [Unmapped]                                                                                +8  +5.9%
  +1.0%     +80 src/core/lib/iomgr/resource_quota.cc                                                     +80  +1.0%
      +9.7%     +48 grpc_resource_user_create                                                                +48  +9.7%
      +8.7%     +24 grpc_resource_quota_create                                                               +24  +8.7%
       +35%     +16 grpc_resource_user_slice_allocator_init                                                  +16   +35%
      +7.1%      +8 grpc_resource_user_shutdown                                                               +8  +7.1%
      +2.5%      +8 grpc_resource_quota_resize                                                                +8  +2.5%
  +1.3%     +80 src/core/lib/iomgr/udp_server.cc                                                         +80  +1.3%
       +10%     +25 GrpcUdpListener::StartListening                                                          +25   +10%
       +11%     +22 GrpcUdpListener::OnFdAboutToOrphan                                                       +22   +11%
      +7.5%     +16 GrpcUdpListener::OnRead                                                                  +16  +7.5%
      +7.9%     +16 GrpcUdpListener::do_write                                                                +16  +7.9%
      +9.5%     +11 GrpcUdpListener::OrphanFd                                                                +11  +9.5%
      +4.5%      +8 GrpcUdpListener::OnCanWrite                                                               +8  +4.5%
  +1.9%     +64 src/core/ext/filters/http/message_compress/message_compress_filter.cc                    +64  +1.9%
       +51%     +75 init_call_elem                                                                           +75   +51%
  +0.9%     +64 src/core/lib/iomgr/tcp_posix.cc                                                          +64  +0.9%
      +1.8%     +16 grpc_tcp_create                                                                          +16  +1.8%
      +3.5%     +16 run_poller                                                                               +16  +3.5%
      +3.2%     +16 notify_on_write                                                                          +16  +3.2%
       +10%     +11 notify_on_read                                                                           +11   +10%
      +2.8%      +5 [Unmapped]                                                                                +5  +2.8%
  +7.8%     +48 src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc     +48  +7.8%
       +23%     +34 init_call_elem                                                                           +34   +23%
       +13%     +16 start_transport_stream_op_batch                                                          +16   +13%
  +0.9%     +48 src/core/ext/filters/message_size/message_size_filter.cc                                 +48  +0.9%
      +8.1%     +40 init_call_elem                                                                           +40  +8.1%
      +4.8%      +8 [Unmapped]                                                                                +8  +4.8%

 -------------- SHRINKING                                                                            --------------
  -0.0%     -50 [None]                                                                               -4.06Ki  -0.0%
  -7.8%     -22 src/core/lib/gpr/arena.cc                                                                -22  -7.8%
     -17.9%     -22 gpr_arena_alloc                                                                          -22 -17.9%
     -15.0%      -3 [Unmapped]                                                                                -3 -15.0%

  +0.3% +4.73Ki TOTAL                                                                                   +728  +0.0%


****************************************************************

libgrpc++.so

     VM SIZE              FILE SIZE
 ++++++++++++++ GROWIN ++++++++++++++

 -------------- SHRINK --------------
  [ = ]       0 [None]    -232  -0.0%

  [ = ]       0 TOTAL     -232  -0.0%



@grpc-testing
Copy link
Copy Markdown

[trickle] No significant performance differences

@soheilhy soheilhy added the release notes: no Indicates if PR should not be in release notes label Oct 19, 2018
@soheilhy
Copy link
Copy Markdown
Contributor Author

BTW, the sanity check failures are due to calling memset(0) over OrphanablePtr which is not trivially copyable. Please note that assignment doesn't work here, because unique_ptr will try to delete the existing (random/garbage) pointer data it think it has due to uninitialized memory.

@grpc-testing
Copy link
Copy Markdown

Objective-C binary sizes
*****************STATIC******************
  New size                      Old size
   710,799       Core (>)        709,723

 1,997,361      Total (>)      1,996,269

***************FRAMEWORKS****************
  New size                      Old size
11,020,631      Total (>)     11,020,624

 No significant differences in binary sizes


@grpc-testing
Copy link
Copy Markdown

Corrupt JSON data (indicates timeout or crash): 
    bm_call_create.BM_IsolatedFilter_ClientChannelFilter_NoOp_.counters.new: 10
    bm_call_create.BM_IsolatedFilter_ClientChannelFilter_NoOp_.counters.old: 10


[microbenchmarks] Performance differences noted:
Benchmark                                                                            allocs_per_iteration    cpu_time    real_time
-----------------------------------------------------------------------------------  ----------------------  ----------  -----------
BM_ErrorGetStatusCode<SimpleError>                                                                           +6%         +6%
BM_ErrorHttpError<SimpleError>                                                                               +5%         +5%
BM_HpackParserParseHeader<AddIndexedSingleInternedElem, UnrefHeader>                                         -50%        -50%
BM_HpackParserParseHeader<AddIndexedSingleStaticElem, UnrefHeader>                                           -68%        -68%
BM_HpackParserParseHeader<EmptyBatch, UnrefHeader>                                                           -96%        -96%
BM_HpackParserParseHeader<IndexedSingleInternedElem, UnrefHeader>                                            -87%        -87%
BM_HpackParserParseHeader<IndexedSingleStaticElem, UnrefHeader>                                              -92%        -92%
BM_HpackParserParseHeader<KeyIndexedSingleInternedElem, UnrefHeader>                                         -57%        -57%
BM_HpackParserParseHeader<KeyIndexedSingleStaticElem, UnrefHeader>                                           -61%        -61%
BM_HpackParserParseHeader<MoreRepresentativeClientInitialMetadata, OnInitialHeader>                          -16%        -16%
BM_HpackParserParseHeader<MoreRepresentativeClientInitialMetadata, UnrefHeader>                              -31%        -31%
BM_HpackParserParseHeader<NonIndexedBinaryElem<1, false>, UnrefHeader>                                       -56%        -56%
BM_HpackParserParseHeader<NonIndexedBinaryElem<1, true>, UnrefHeader>                                        -57%        -57%
BM_HpackParserParseHeader<NonIndexedBinaryElem<10, false>, UnrefHeader>                                      -45%        -45%
BM_HpackParserParseHeader<NonIndexedBinaryElem<10, true>, UnrefHeader>                                       -63%        -63%
BM_HpackParserParseHeader<NonIndexedBinaryElem<100, false>, UnrefHeader>                                     -5%         -5%
BM_HpackParserParseHeader<NonIndexedBinaryElem<100, true>, UnrefHeader>                                      -48%        -48%
BM_HpackParserParseHeader<NonIndexedBinaryElem<3, false>, UnrefHeader>                                       -59%        -59%
BM_HpackParserParseHeader<NonIndexedBinaryElem<3, true>, UnrefHeader>                                        -58%        -58%
BM_HpackParserParseHeader<NonIndexedBinaryElem<31, false>, UnrefHeader>                                      -27%        -27%
BM_HpackParserParseHeader<NonIndexedBinaryElem<31, true>, UnrefHeader>                                       -55%        -55%
BM_HpackParserParseHeader<NonIndexedElem, UnrefHeader>                                                       -55%        -55%
BM_HpackParserParseHeader<RepresentativeClientInitialMetadata, OnInitialHeader>                              -20%        -20%
BM_HpackParserParseHeader<RepresentativeClientInitialMetadata, UnrefHeader>                                  -67%        -67%
BM_HpackParserParseHeader<RepresentativeServerInitialMetadata, OnInitialHeader>                              -52%        -52%
BM_HpackParserParseHeader<RepresentativeServerInitialMetadata, UnrefHeader>                                  -87%        -87%
BM_HpackParserParseHeader<RepresentativeServerTrailingMetadata, UnrefHeader>                                 -82%        -82%
BM_HpackParserParseHeader<SameDeadline, OnHeaderTimeout>                                                     -60%        -60%
BM_IsolatedFilter<ClientChannelFilter, NoOp>                                                                 +42%        +42%
BM_IsolatedFilter<HttpServerFilter, NoOp>                                                                    +11%        +11%
BM_LameChannelCallCreateCore                                                         -6%
BM_LameChannelCallCreateCoreSeparateBatch                                            -5%
BM_LameChannelCallCreateCpp                                                          -5%

Copy link
Copy Markdown
Member

@markdroth markdroth left a comment

Choose a reason for hiding this comment

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

I've reviewed everything except the chttp2 changes; I assume @ncteisen will do that.

Thanks for doing this!

Reviewed 22 of 22 files at r1.
Reviewable status: all files reviewed, 19 unresolved discussions (waiting on @soheilhy, @yang-g, @AspirinSJL, @yashykt, @ncteisen, @vjpai, and @apolcyn)


src/core/ext/filters/client_channel/client_channel.cc, line 1590 at r1 (raw file):

  batch_data->batch.recv_trailing_metadata = false;
  batch_data->batch.cancel_stream = false;

Nit: Please remove unnecessary blank line.


src/core/ext/filters/client_channel/client_channel.cc, line 3167 at r1 (raw file):

  calld->owning_call = args->call_stack;
  calld->call_combiner = args->call_combiner;
  memset(&calld->deadline_state, 0, sizeof(calld->deadline_state));

I suggest moving this into grpc_deadline_state_init().


src/core/ext/filters/client_channel/client_channel.cc, line 3172 at r1 (raw file):

                             calld->deadline);
  }

Nit: Please remove unnecessary blank line.


src/core/ext/filters/client_channel/client_channel.cc, line 3173 at r1 (raw file):

  }

  calld->subchannel_call = nullptr;

General comment, applies to most of the changes in this PR:

Please initialize these fields in the same order in which they are defined in the struct, so that it's easy to verify that we haven't missed anything. (If the order here is performance sensitive, this seems rather brittle, since we have nothing guaranteeing that we won't change the order later.)

Alternatively... Would it make sense to set the initial values for these fields in the spot where they are defined, and then change this code to do a C++ placement-new to initialize it? That way, this could all be done in one place, and there would be no need for special handling of the C++ members (such as the RefCountedPtr<> members). That should also allow us to eliminate the use of ManualConstructor<> for the send_messages field. Note that this would require manually invoking the dtor from cc_destroy_call_elem().

It seems like the latter approach would work well in a number of places (all the filters and for the grpc_call struct, and the grpc_transport_stream_op_batch struct).


src/core/ext/filters/client_channel/client_channel.cc, line 3187 at r1 (raw file):

  calld->peer_string = nullptr;
  calld->subchannel_call = nullptr;
  calld->cancel_error = nullptr;

This should be GRPC_ERROR_NONE.


src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc, line 76 at r1 (raw file):

  // Get stats object from context and take a ref.
  GPR_ASSERT(args->context != nullptr);
  memset(&calld->client_stats, 0, sizeof(calld->client_stats));

This is another case where C++ placement-new might be helpful.


src/core/ext/filters/deadline/deadline_filter.cc, line 202 at r1 (raw file):

    struct start_timer_after_init_state* state =
        static_cast<struct start_timer_after_init_state*>(
            gpr_malloc(sizeof(*state)));

Suggest using grpc_core::New<> here (and grpc_core::Delete<> in start_timer_after_init()), so that the field below can be initialized in-line.


src/core/ext/filters/http/client/http_client_filter.cc, line 448 at r1 (raw file):

  calld->call_combiner = args->call_combiner;
  calld->recv_initial_metadata = nullptr;
  calld->recv_initial_metadata_error = nullptr;

GRPC_ERROR_NONE


src/core/ext/filters/http/client/http_client_filter.cc, line 456 at r1 (raw file):

  calld->original_send_message_on_complete = nullptr;
  calld->recv_initial_metadata = nullptr;
  calld->recv_initial_metadata_error = nullptr;

GRPC_ERROR_NONE


src/core/ext/filters/http/server/http_server_filter.cc, line 438 at r1 (raw file):

  calld->have_read_stream = false;
  calld->recv_initial_metadata_flags = nullptr;
  calld->recv_initial_metadata_ready_error = nullptr;

GRPC_ERROR_NONE


src/core/ext/filters/http/server/http_server_filter.cc, line 445 at r1 (raw file):

  calld->recv_message = nullptr;
  calld->original_recv_trailing_metadata_ready = nullptr;
  calld->recv_initial_metadata_ready_error = nullptr;

GRPC_ERROR_NONE


src/core/ext/filters/message_size/message_size_filter.cc, line 238 at r1 (raw file):

  calld->original_recv_trailing_metadata_ready = nullptr;
  calld->seen_recv_trailing_metadata = false;
  calld->recv_trailing_metadata_error = nullptr;

GRPC_ERROR_NONE


src/core/lib/gpr/arena.cc, line 93 at r1 (raw file):

};

static void* malloc_aligned(size_t size) {

There's not really any need for this function anymore; I suggest just changing the callers to directly call gpr_malloc_aligned().


src/core/lib/security/transport/server_auth_filter.cc, line 254 at r1 (raw file):

  calld->original_recv_initial_metadata_ready = nullptr;
  calld->original_recv_trailing_metadata_ready = nullptr;
  calld->recv_initial_metadata_error = nullptr;

GRPC_ERROR_NONE


src/core/lib/security/transport/server_auth_filter.cc, line 255 at r1 (raw file):

  calld->original_recv_trailing_metadata_ready = nullptr;
  calld->recv_initial_metadata_error = nullptr;
  calld->recv_trailing_metadata_error = nullptr;

GRPC_ERROR_NONE


src/core/lib/surface/call.cc, line 297 at r1 (raw file):

  GPR_TIMER_SCOPE("grpc_call_create", 0);

  GRPC_CHANNEL_INTERNAL_REF(args->channel, "call");

Why move this to the top of this function? Seems unrelated to the rest of this PR.


src/core/lib/surface/call.cc, line 310 at r1 (raw file):

      gpr_arena_alloc(arena, GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(grpc_call)) +
                                 channel_stack->call_stack_size);
  call = reinterpret_cast<grpc_call*>(mem);

Any reason for doing this in a separate statement from the allocation?


src/core/lib/surface/call.cc, line 314 at r1 (raw file):

  call->arena = arena;
  call->cq = args->cq;
  *out_call = call;

How about moving this either up to line 311, or down to the end of this function, right before we return? That way, it's not sitting right in the middle of the fields we're initializing.


src/core/lib/surface/call.cc, line 1162 at r1 (raw file):

  bctl->op.recv_trailing_metadata = false;
  bctl->op.cancel_stream = false;
  bctl->op.handler_private.extra_arg = nullptr;

I don't think this needs to be initialized here -- it will be set before it ever gets used.

Copy link
Copy Markdown
Contributor Author

@soheilhy soheilhy left a comment

Choose a reason for hiding this comment

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

Thank you @markdroth for the quick and great review!

Reviewable status: all files reviewed, 17 unresolved discussions (waiting on @markdroth, @soheilhy, @yang-g, @AspirinSJL, @yashykt, @ncteisen, @vjpai, and @apolcyn)


src/core/ext/filters/client_channel/client_channel.cc, line 1590 at r1 (raw file):

Previously, markdroth (Mark D. Roth) wrote…

Nit: Please remove unnecessary blank line.

Sure, done.


src/core/ext/filters/client_channel/client_channel.cc, line 3167 at r1 (raw file):

Previously, markdroth (Mark D. Roth) wrote…

I suggest moving this into grpc_deadline_state_init().

Actually your comment reminded me that, I fixed the underlying bug that would require this memset(). This is now removed. :-)


src/core/ext/filters/client_channel/client_channel.cc, line 3172 at r1 (raw file):

Previously, markdroth (Mark D. Roth) wrote…

Nit: Please remove unnecessary blank line.

Sure, done.


src/core/ext/filters/client_channel/client_channel.cc, line 3173 at r1 (raw file):

Previously, markdroth (Mark D. Roth) wrote…

General comment, applies to most of the changes in this PR:

Please initialize these fields in the same order in which they are defined in the struct, so that it's easy to verify that we haven't missed anything. (If the order here is performance sensitive, this seems rather brittle, since we have nothing guaranteeing that we won't change the order later.)

Alternatively... Would it make sense to set the initial values for these fields in the spot where they are defined, and then change this code to do a C++ placement-new to initialize it? That way, this could all be done in one place, and there would be no need for special handling of the C++ members (such as the RefCountedPtr<> members). That should also allow us to eliminate the use of ManualConstructor<> for the send_messages field. Note that this would require manually invoking the dtor from cc_destroy_call_elem().

It seems like the latter approach would work well in a number of places (all the filters and for the grpc_call struct, and the grpc_transport_stream_op_batch struct).

Certainly, I will reorder the fields in the next revision while waiting for Noah's review on HTTP2 stuff. I've reordered some but it's not complete yet.

As for C++, I agree that it would the right approach, but the problem is that at the moment we lack proper ctors. When we use placement new, we will incur a memset(0), which we really don't want to initialize (or we will initialize later). When I tried that approach in Sep, I observe 5-10% regression in the microbenchmarks and application benchmarks.

I think we should definitely do that (I will make sure it happens), but perhaps later as a follow up to this patch. We can do that on a per class basis: add proper ctor, and then move call data init to placement new.

P.S. For grpc_call, specifically, it will be a bit tricky due to cache misses. There are too many blobs of data that we really don't want to initialize before filter initialization.


src/core/ext/filters/client_channel/client_channel.cc, line 3187 at r1 (raw file):

Previously, markdroth (Mark D. Roth) wrote…

This should be GRPC_ERROR_NONE.

Good catch. Done.


src/core/ext/filters/deadline/deadline_filter.cc, line 202 at r1 (raw file):

Previously, markdroth (Mark D. Roth) wrote…

Suggest using grpc_core::New<> here (and grpc_core::Delete<> in start_timer_after_init()), so that the field below can be initialized in-line.

I wasn't aware of those methods. Thank you for the pointers. Please see my comment about C++'ifying the code above. While I agree that's the right approach for long term, here a simple initialization would come at a cost of initialization the closure structure twice (one in new and one in GRPC_CLOSURE_INIT). Would you mind please if we do this later?


src/core/ext/filters/http/client/http_client_filter.cc, line 448 at r1 (raw file):

Previously, markdroth (Mark D. Roth) wrote…

GRPC_ERROR_NONE

Done.


src/core/ext/filters/http/client/http_client_filter.cc, line 456 at r1 (raw file):

Previously, markdroth (Mark D. Roth) wrote…

GRPC_ERROR_NONE

Done.


src/core/ext/filters/http/server/http_server_filter.cc, line 438 at r1 (raw file):

Previously, markdroth (Mark D. Roth) wrote…

GRPC_ERROR_NONE

Done.


src/core/ext/filters/http/server/http_server_filter.cc, line 445 at r1 (raw file):

Previously, markdroth (Mark D. Roth) wrote…

GRPC_ERROR_NONE

Done.


src/core/ext/filters/message_size/message_size_filter.cc, line 238 at r1 (raw file):

Previously, markdroth (Mark D. Roth) wrote…

GRPC_ERROR_NONE

Done.


src/core/lib/gpr/arena.cc, line 93 at r1 (raw file):

Previously, markdroth (Mark D. Roth) wrote…

There's not really any need for this function anymore; I suggest just changing the callers to directly call gpr_malloc_aligned().

Sure, done. I don't have a strong preference here, but thought it would create a larger diff. so I avoided that.


src/core/lib/security/transport/server_auth_filter.cc, line 254 at r1 (raw file):

Previously, markdroth (Mark D. Roth) wrote…

GRPC_ERROR_NONE

Done.


src/core/lib/security/transport/server_auth_filter.cc, line 255 at r1 (raw file):

Previously, markdroth (Mark D. Roth) wrote…

GRPC_ERROR_NONE

Done.


src/core/lib/surface/call.cc, line 297 at r1 (raw file):

Previously, markdroth (Mark D. Roth) wrote…

Why move this to the top of this function? Seems unrelated to the rest of this PR.

Good question. So, the problem is that initialization of the whole call structure causes a lot of cache to be evicted. When we reach the line to ref the channel after initialization, we always had a cache-miss hence a regression with this patch. Previously, because memset(0) was before everything else, we would end up pulling the channel into cache before entering this function.

So, to avoid a single digit performance regression I moved it to top of function before everything else.


src/core/lib/surface/call.cc, line 310 at r1 (raw file):

Previously, markdroth (Mark D. Roth) wrote…

Any reason for doing this in a separate statement from the allocation?

Good catch. I used this during the (very painful :P) debugging of this patch. Removed.


src/core/lib/surface/call.cc, line 314 at r1 (raw file):

Previously, markdroth (Mark D. Roth) wrote…

How about moving this either up to line 311, or down to the end of this function, right before we return? That way, it's not sitting right in the middle of the fields we're initializing.

Excellent point. Done.


src/core/lib/surface/call.cc, line 1162 at r1 (raw file):

Previously, markdroth (Mark D. Roth) wrote…

I don't think this needs to be initialized here -- it will be set before it ever gets used.

Oh, yes, thank you for catching this. I think I have fixed the underlying cause of this issue, but forgot to remove it.

Copy link
Copy Markdown
Contributor Author

@soheilhy soheilhy left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 17 unresolved discussions (waiting on @markdroth, @soheilhy, @yang-g, @AspirinSJL, @yashykt, @ncteisen, @vjpai, and @apolcyn)


src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc, line 76 at r1 (raw file):

Previously, markdroth (Mark D. Roth) wrote…

This is another case where C++ placement-new might be helpful.

I missed to reply this one. Please see my comments above.

I can change this one to calld->client_stats = {}; if you would prefer that. Thank you.

@grpc-testing
Copy link
Copy Markdown

****************************************************************

libgrpc.so

     VM SIZE                                                                                            FILE SIZE
 ++++++++++++++ GROWING                                                                              ++++++++++++++
  +2.6%    +848 src/core/ext/transport/chttp2/transport/chttp2_transport.cc                             +848  +2.6%
      +133%    +613 init_stream                                                                             +613  +133%
      +4.1%    +144 grpc_create_chttp2_transport                                                            +144  +4.1%
      +3.7%     +16 write_action_end_locked                                                                  +16  +3.7%
      +0.5%     +16 perform_stream_op_locked                                                                 +16  +0.5%
      +3.2%     +16 write_action_begin_locked                                                                +16  +3.2%
      +7.5%     +11 grpc_chttp2_initiate_write                                                               +11  +7.5%
       +16%     +11 write_action                                                                             +11   +16%
      +7.6%     +11 perform_transport_op                                                                     +11  +7.6%
       +20%     +11 grpc_core::Chttp2IncomingByteStream::Orphan                                              +11   +20%
      +6.7%      +8 destroy_stream                                                                            +8  +6.7%
      +9.4%      +8 destroy_transport                                                                         +8  +9.4%
      +2.4%      +8 perform_stream_op                                                                         +8  +2.4%
      +7.9%      +8 grpc_core::Chttp2IncomingByteStream::Next                                                 +8  +7.9%
  +5.3%    +848 src/core/lib/surface/call.cc                                                            +848  +5.3%
       +31%    +600 grpc_call_create                                                                        +600   +31%
      +6.9%    +236 call_start_batch                                                                        +236  +6.9%
      +7.2%     +16 cancel_with_error                                                                        +16  +7.2%
      +3.3%     +16 receiving_stream_ready                                                                   +16  +3.3%
      +1.0%     +16 receiving_initial_metadata_ready                                                         +16  +1.0%
      +2.3%      +8 destroy_call                                                                              +8  +2.3%
  +2.0%    +768 src/core/ext/filters/client_channel/client_channel.cc                                   +768  +2.0%
      +132%    +356 cc_init_call_elem                                                                       +356  +132%
      +1.0%     +48 on_resolver_result_changed_locked                                                        +48  +1.0%
      +1.3%     +48 start_retriable_subchannel_batches                                                       +48  +1.3%
      +5.4%     +48 pick_done                                                                                +48  +5.4%
      +2.4%     +32 cc_init_channel_elem                                                                     +32  +2.4%
      +6.1%     +32 cc_destroy_channel_elem                                                                  +32  +6.1%
      +2.7%     +32 process_service_config_and_start_lb_pick_locked                                          +32  +2.7%
       +15%     +25 batch_data_create                                                                        +25   +15%
      +1.1%     +24 run_closures_for_completed_call                                                          +24  +1.1%
      +9.4%     +16 [Other]                                                                                  +16  +9.4%
      +1.2%     +16 pending_batches_fail                                                                     +16  +1.2%
       +10%     +16 cc_start_transport_op                                                                    +16   +10%
      +1.5%     +16 pending_batches_resume                                                                   +16  +1.5%
      +0.7%     +11 maybe_retry                                                                              +11  +0.7%
      +9.6%     +11 pick_done_locked                                                                         +11  +9.6%
      +4.8%     +11 start_internal_recv_trailing_metadata                                                    +11  +4.8%
      +6.6%      +8 grpc_client_channel_check_connectivity_state                                              +8  +6.6%
      +4.9%      +8 grpc_client_channel_watch_connectivity_state                                              +8  +4.9%
      +1.2%      +8 start_pick_locked                                                                         +8  +1.2%
      +6.9%      +8 watch_lb_policy_locked                                                                    +8  +6.9%
      +2.1%      +8 add_closure_for_subchannel_batch(grpc_call_element*, grpc_transport_stream_op_batch*      +8  +2.1%
  +0.7%    +744 [Other]                                                                                 +744  +0.7%
  +1.0%    +160 src/core/lib/surface/server.cc                                                          +160  +1.0%
      +4.1%     +24 publish_new_rpc                                                                          +24  +4.1%
       +11%     +22 init_call_elem                                                                           +22   +11%
      +6.6%     +19 finish_start_new_rpc                                                                     +19  +6.6%
      +5.1%     +17 accept_stream                                                                            +17  +5.1%
      +4.7%     +16 [Unmapped]                                                                               +16  +4.7%
      +2.4%     +16 grpc_server_request_registered_call                                                      +16  +2.4%
      +2.3%     +11 queue_call_request                                                                       +11  +2.3%
      +8.1%     +11 request_matcher_zombify_all_pending_calls((anonymous namespace)::request_matcher*) [     +11  +8.1%
      +3.9%      +8 init_channel_elem                                                                         +8  +3.9%
      +0.9%      +8 grpc_server_shutdown_and_notify                                                           +8  +0.9%
      +1.4%      +8 grpc_server_start                                                                         +8  +1.4%
  +4.7%    +152 src/core/lib/security/transport/client_auth_filter.cc                                   +152  +4.7%
       +84%    +113 init_call_elem                                                                          +113   +84%
      +4.0%     +24 auth_start_transport_stream_op_batch                                                     +24  +4.0%
      +2.0%     +16 on_host_checked                                                                          +16  +2.0%
  +2.7%    +144 src/core/ext/filters/http/client/http_client_filter.cc                                  +144  +2.7%
      +102%    +139 init_call_elem                                                                          +139  +102%
      +6.8%      +5 [Unmapped]                                                                                +5  +6.8%
  +3.2%    +144 src/core/ext/filters/http/server/http_server_filter.cc                                  +144  +3.2%
      +128%    +138 hs_init_call_elem                                                                       +138  +128%
      +6.8%      +6 [Unmapped]                                                                                +6  +6.8%
  +5.4%    +144 src/core/lib/security/transport/server_auth_filter.cc                                   +144  +5.4%
      +103%    +146 init_call_elem                                                                          +146  +103%
      +1.1%      +8 recv_initial_metadata_ready                                                               +8  +1.1%
  +0.8%    +128 src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc                          +128  +0.8%
      +3.2%     +33 grpc_core::(anonymous namespace)::GrpcLbFactory::CreateLoadBalancingPolicy(grpc_core     +33  +3.2%
      +2.0%     +32 grpc_core::(anonymous namespace)::GrpcLb::StartBalancerCallLocked                        +32  +2.0%
      +0.9%     +16 grpc_core::(anonymous namespace)::GrpcLb::CreateOrUpdateRoundRobinPolicyLocked() [cl     +16  +0.9%
      +4.3%     +16 grpc_core::(anonymous namespace)::GrpcLb::~GrpcLb                                        +16  +4.3%
      +9.2%     +11 grpc_core::(anonymous namespace)::GrpcLb::BalancerCallState::ScheduleNextClientLoadR     +11  +9.2%
      +6.1%     +11 grpc_core::(anonymous namespace)::GrpcLb::StartPickingLocked                             +11  +6.1%
      +2.6%      +8 grpc_core::(anonymous namespace)::GrpcLb::PickLocked                                      +8  +2.6%
      +1.4%      +8 grpc_core::(anonymous namespace)::GrpcLb::BalancerCallState::SendClientLoadReportLoc      +8  +1.4%
  +0.8%    +128 src/core/ext/filters/client_channel/lb_policy/xds/xds.cc                                +128  +0.8%
      +3.2%     +33 grpc_core::(anonymous namespace)::XdsFactory::CreateLoadBalancingPolicy(grpc_core::L     +33  +3.2%
      +2.0%     +32 grpc_core::(anonymous namespace)::XdsLb::StartBalancerCallLocked                         +32  +2.0%
      +0.9%     +16 grpc_core::(anonymous namespace)::XdsLb::CreateOrUpdateRoundRobinPolicyLocked() [clo     +16  +0.9%
      +4.3%     +16 grpc_core::(anonymous namespace)::XdsLb::~XdsLb                                          +16  +4.3%
      +9.2%     +11 grpc_core::(anonymous namespace)::XdsLb::BalancerCallState::ScheduleNextClientLoadRe     +11  +9.2%
      +6.1%     +11 grpc_core::(anonymous namespace)::XdsLb::StartPickingLocked                              +11  +6.1%
      +2.6%      +8 grpc_core::(anonymous namespace)::XdsLb::PickLocked                                       +8  +2.6%
      +1.4%      +8 grpc_core::(anonymous namespace)::XdsLb::BalancerCallState::SendClientLoadReportLock      +8  +1.4%
  +1.2%     +96 src/core/ext/filters/client_channel/subchannel.cc                                        +96  +1.2%
      +7.0%     +18 [Unmapped]                                                                               +18  +7.0%
      +1.1%     +16 grpc_subchannel_create                                                                   +16  +1.1%
      +5.0%     +16 grpc_core::ConnectedSubchannel::CreateCall                                               +16  +5.0%
      +4.0%     +14 maybe_start_connecting_locked                                                            +14  +4.0%
      +8.0%      +8 grpc_subchannel_weak_unref                                                                +8  +8.0%
      +3.7%      +8 grpc_subchannel_call_process_op                                                           +8  +3.7%
      +2.8%      +8 grpc_subchannel_notify_on_state_change                                                    +8  +2.8%
      +0.8%      +8 on_subchannel_connected                                                                   +8  +0.8%
  +0.6%     +96 src/core/ext/transport/inproc/inproc_transport.cc                                        +96  +0.6%
      +8.3%     +80 init_stream                                                                              +80  +8.3%
      +0.6%     +16 perform_stream_op                                                                        +16  +0.6%
  +3.7%     +80 src/core/ext/filters/deadline/deadline_filter.cc                                         +80  +3.7%
       +28%     +32 grpc_deadline_state_init                                                                 +32   +28%
      +6.5%     +16 server_start_transport_stream_op_batch                                                   +16  +6.5%
      +7.7%      +8 grpc_deadline_state_client_start_transport_stream_op_batch                                +8  +7.7%
      +3.0%      +8 timer_callback                                                                            +8  +3.0%
      +3.2%      +8 start_timer_if_needed(grpc_call_element*, long) [clone .part.2]                           +8  +3.2%
      +6.7%      +8 send_cancel_op_in_call_combiner                                                           +8  +6.7%
  +2.8%     +80 src/core/ext/filters/max_age/max_age_filter.cc                                           +80  +2.8%
      +8.9%     +72 init_channel_elem                                                                        +72  +8.9%
      +5.9%      +8 [Unmapped]                                                                                +8  +5.9%
  +1.0%     +80 src/core/lib/iomgr/resource_quota.cc                                                     +80  +1.0%
      +9.7%     +48 grpc_resource_user_create                                                                +48  +9.7%
      +8.7%     +24 grpc_resource_quota_create                                                               +24  +8.7%
       +35%     +16 grpc_resource_user_slice_allocator_init                                                  +16   +35%
      +7.1%      +8 grpc_resource_user_shutdown                                                               +8  +7.1%
      +2.5%      +8 grpc_resource_quota_resize                                                                +8  +2.5%
  +1.3%     +80 src/core/lib/iomgr/udp_server.cc                                                         +80  +1.3%
       +10%     +25 GrpcUdpListener::StartListening                                                          +25   +10%
       +11%     +22 GrpcUdpListener::OnFdAboutToOrphan                                                       +22   +11%
      +7.5%     +16 GrpcUdpListener::OnRead                                                                  +16  +7.5%
      +7.9%     +16 GrpcUdpListener::do_write                                                                +16  +7.9%
      +9.5%     +11 GrpcUdpListener::OrphanFd                                                                +11  +9.5%
      +4.5%      +8 GrpcUdpListener::OnCanWrite                                                               +8  +4.5%
  +1.9%     +64 src/core/ext/filters/http/message_compress/message_compress_filter.cc                    +64  +1.9%
       +51%     +75 init_call_elem                                                                           +75   +51%
  +0.9%     +64 src/core/lib/iomgr/tcp_posix.cc                                                          +64  +0.9%
      +1.8%     +16 grpc_tcp_create                                                                          +16  +1.8%
      +3.5%     +16 run_poller                                                                               +16  +3.5%
      +3.2%     +16 notify_on_write                                                                          +16  +3.2%
       +10%     +11 notify_on_read                                                                           +11   +10%
      +2.8%      +5 [Unmapped]                                                                                +5  +2.8%
  +7.8%     +48 src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc     +48  +7.8%
       +23%     +34 init_call_elem                                                                           +34   +23%
       +13%     +16 start_transport_stream_op_batch                                                          +16   +13%
  +0.9%     +48 src/core/ext/filters/message_size/message_size_filter.cc                                 +48  +0.9%
      +8.1%     +40 init_call_elem                                                                           +40  +8.1%
      +4.8%      +8 [Unmapped]                                                                                +8  +4.8%

 -------------- SHRINKING                                                                            --------------
  -0.0%     -42 [None]                                                                               -4.42Ki  -0.0%
  -7.8%     -22 src/core/lib/gpr/arena.cc                                                                -22  -7.8%
     -17.9%     -22 gpr_arena_alloc                                                                          -22 -17.9%
     -15.0%      -3 [Unmapped]                                                                                -3 -15.0%

  +0.3% +4.77Ki TOTAL                                                                                   +400  +0.0%


****************************************************************

libgrpc++.so

     VM SIZE              FILE SIZE
 ++++++++++++++ GROWIN ++++++++++++++

 -------------- SHRINK --------------
  [ = ]       0 [None]    -232  -0.0%

  [ = ]       0 TOTAL     -232  -0.0%



@grpc-testing
Copy link
Copy Markdown

[trickle] No significant performance differences

@grpc-testing
Copy link
Copy Markdown

Objective-C binary sizes
*****************STATIC******************
  New size                      Old size
   711,776       Core (>)        710,680

 1,998,354      Total (>)      1,997,238

***************FRAMEWORKS****************
  New size                      Old size
11,021,756      Total (<)     11,021,758

 No significant differences in binary sizes


@grpc-testing
Copy link
Copy Markdown

Corrupt JSON data (indicates timeout or crash): 
    bm_call_create.BM_IsolatedFilter_ClientChannelFilter_NoOp_.counters.new: 10
    bm_call_create.BM_IsolatedFilter_ClientChannelFilter_NoOp_.counters.old: 10


[microbenchmarks] Performance differences noted:
Benchmark                                                                            allocs_per_iteration    cpu_time    real_time
-----------------------------------------------------------------------------------  ----------------------  ----------  -----------
BM_ErrorHttpError<SimpleError>                                                                               -9%         -9%
BM_HpackParserParseHeader<AddIndexedSingleInternedElem, UnrefHeader>                                         -37%        -37%
BM_HpackParserParseHeader<AddIndexedSingleStaticElem, UnrefHeader>                                           -63%        -63%
BM_HpackParserParseHeader<EmptyBatch, UnrefHeader>                                                           -95%        -95%
BM_HpackParserParseHeader<IndexedSingleInternedElem, UnrefHeader>                                            -87%        -87%
BM_HpackParserParseHeader<IndexedSingleStaticElem, UnrefHeader>                                              -90%        -90%
BM_HpackParserParseHeader<KeyIndexedSingleInternedElem, UnrefHeader>                                         -55%        -55%
BM_HpackParserParseHeader<KeyIndexedSingleStaticElem, UnrefHeader>                                           -50%        -50%
BM_HpackParserParseHeader<MoreRepresentativeClientInitialMetadata, OnInitialHeader>                          -16%        -16%
BM_HpackParserParseHeader<MoreRepresentativeClientInitialMetadata, UnrefHeader>                              -25%        -25%
BM_HpackParserParseHeader<NonIndexedBinaryElem<1, false>, UnrefHeader>                                       -50%        -50%
BM_HpackParserParseHeader<NonIndexedBinaryElem<1, true>, UnrefHeader>                                        -52%        -52%
BM_HpackParserParseHeader<NonIndexedBinaryElem<10, false>, UnrefHeader>                                      -43%        -43%
BM_HpackParserParseHeader<NonIndexedBinaryElem<10, true>, UnrefHeader>                                       -57%        -57%
BM_HpackParserParseHeader<NonIndexedBinaryElem<100, false>, UnrefHeader>                                     -11%        -11%
BM_HpackParserParseHeader<NonIndexedBinaryElem<100, true>, UnrefHeader>                                      -44%        -44%
BM_HpackParserParseHeader<NonIndexedBinaryElem<3, false>, UnrefHeader>                                       -38%        -38%
BM_HpackParserParseHeader<NonIndexedBinaryElem<3, true>, UnrefHeader>                                        -56%        -56%
BM_HpackParserParseHeader<NonIndexedBinaryElem<31, false>, UnrefHeader>                                      -28%        -28%
BM_HpackParserParseHeader<NonIndexedBinaryElem<31, true>, UnrefHeader>                                       -49%        -49%
BM_HpackParserParseHeader<NonIndexedElem, UnrefHeader>                                                       -47%        -47%
BM_HpackParserParseHeader<RepresentativeClientInitialMetadata, OnInitialHeader>                              -30%        -30%
BM_HpackParserParseHeader<RepresentativeClientInitialMetadata, UnrefHeader>                                  -59%        -59%
BM_HpackParserParseHeader<RepresentativeServerInitialMetadata, OnInitialHeader>                              -53%        -53%
BM_HpackParserParseHeader<RepresentativeServerInitialMetadata, UnrefHeader>                                  -81%        -81%
BM_HpackParserParseHeader<RepresentativeServerTrailingMetadata, UnrefHeader>                                 -82%        -82%
BM_HpackParserParseHeader<SameDeadline, OnHeaderTimeout>                                                     -52%        -52%
BM_IsolatedFilter<ClientChannelFilter, NoOp>                                                                 +34%        +34%
BM_IsolatedFilter<HttpServerFilter, NoOp>                                                                    +10%        +10%
BM_LameChannelCallCreateCore                                                         -6%
BM_LameChannelCallCreateCoreSeparateBatch                                            -5%
BM_LameChannelCallCreateCpp                                                          -5%
BM_MetadataRefUnrefExternal                                                                                  -10%        -10%
BM_MetadataRefUnrefStatic                                                                                    +5%         +5%

Copy link
Copy Markdown
Contributor Author

@soheilhy soheilhy left a comment

Choose a reason for hiding this comment

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

Reviewable status: 10 of 22 files reviewed, 17 unresolved discussions (waiting on @markdroth, @soheilhy, @yang-g, @AspirinSJL, @yashykt, @ncteisen, @vjpai, and @apolcyn)


src/core/ext/filters/client_channel/client_channel.cc, line 3173 at r1 (raw file):

Previously, soheilhy (Soheil Hassas Yeganeh) wrote…

Certainly, I will reorder the fields in the next revision while waiting for Noah's review on HTTP2 stuff. I've reordered some but it's not complete yet.

As for C++, I agree that it would the right approach, but the problem is that at the moment we lack proper ctors. When we use placement new, we will incur a memset(0), which we really don't want to initialize (or we will initialize later). When I tried that approach in Sep, I observe 5-10% regression in the microbenchmarks and application benchmarks.

I think we should definitely do that (I will make sure it happens), but perhaps later as a follow up to this patch. We can do that on a per class basis: add proper ctor, and then move call data init to placement new.

P.S. For grpc_call, specifically, it will be a bit tricky due to cache misses. There are too many blobs of data that we really don't want to initialize before filter initialization.

I made a pass through all initialization and reorder them to match the definition order of fields. As I mentioned grpc_call is tricky and I would like to send a follow up patch to reorder the fields to make them more cache friendly.

P.S. there are a few additional changes from error = nullptr to error = GRPC_ERROR_NONE in the original code, and a few initializations of booleans using false/true instead of previously 0/1.

PTAL. Thank you

@grpc-testing
Copy link
Copy Markdown

****************************************************************

libgrpc.so

     VM SIZE                                                                                            FILE SIZE
 ++++++++++++++ GROWING                                                                              ++++++++++++++
  +2.8%    +912 src/core/ext/transport/chttp2/transport/chttp2_transport.cc                             +912  +2.8%
      +133%    +613 init_stream                                                                             +613  +133%
      +6.0%    +208 grpc_create_chttp2_transport                                                            +208  +6.0%
      +3.7%     +16 write_action_end_locked                                                                  +16  +3.7%
      +0.5%     +16 perform_stream_op_locked                                                                 +16  +0.5%
      +3.2%     +16 write_action_begin_locked                                                                +16  +3.2%
      +7.5%     +11 grpc_chttp2_initiate_write                                                               +11  +7.5%
       +16%     +11 write_action                                                                             +11   +16%
      +7.6%     +11 perform_transport_op                                                                     +11  +7.6%
       +20%     +11 grpc_core::Chttp2IncomingByteStream::Orphan                                              +11   +20%
      +6.7%      +8 destroy_stream                                                                            +8  +6.7%
      +9.4%      +8 destroy_transport                                                                         +8  +9.4%
      +2.4%      +8 perform_stream_op                                                                         +8  +2.4%
      +7.9%      +8 grpc_core::Chttp2IncomingByteStream::Next                                                 +8  +7.9%
  +5.2%    +832 src/core/lib/surface/call.cc                                                            +832  +5.2%
       +30%    +584 grpc_call_create                                                                        +584   +30%
      +6.9%    +236 call_start_batch                                                                        +236  +6.9%
      +7.2%     +16 cancel_with_error                                                                        +16  +7.2%
      +3.3%     +16 receiving_stream_ready                                                                   +16  +3.3%
      +1.0%     +16 receiving_initial_metadata_ready                                                         +16  +1.0%
      +2.3%      +8 destroy_call                                                                              +8  +2.3%
  +0.7%    +760 [Other]                                                                                 +760  +0.7%
  +1.9%    +736 src/core/ext/filters/client_channel/client_channel.cc                                   +736  +1.9%
      +123%    +330 cc_init_call_elem                                                                       +330  +123%
      +1.0%     +48 on_resolver_result_changed_locked                                                        +48  +1.0%
      +1.3%     +48 start_retriable_subchannel_batches                                                       +48  +1.3%
      +5.4%     +48 pick_done                                                                                +48  +5.4%
      +2.4%     +32 cc_init_channel_elem                                                                     +32  +2.4%
      +6.1%     +32 cc_destroy_channel_elem                                                                  +32  +6.1%
      +2.7%     +32 process_service_config_and_start_lb_pick_locked                                          +32  +2.7%
       +15%     +25 batch_data_create                                                                        +25   +15%
      +1.1%     +24 run_closures_for_completed_call                                                          +24  +1.1%
      +9.4%     +16 [Other]                                                                                  +16  +9.4%
      +1.2%     +16 pending_batches_fail                                                                     +16  +1.2%
       +10%     +16 cc_start_transport_op                                                                    +16   +10%
      +1.5%     +16 pending_batches_resume                                                                   +16  +1.5%
      +0.7%     +11 maybe_retry                                                                              +11  +0.7%
      +9.6%     +11 pick_done_locked                                                                         +11  +9.6%
      +4.8%     +11 start_internal_recv_trailing_metadata                                                    +11  +4.8%
      +6.6%      +8 grpc_client_channel_check_connectivity_state                                              +8  +6.6%
      +4.9%      +8 grpc_client_channel_watch_connectivity_state                                              +8  +4.9%
      +1.2%      +8 start_pick_locked                                                                         +8  +1.2%
      +6.9%      +8 watch_lb_policy_locked                                                                    +8  +6.9%
      +2.1%      +8 add_closure_for_subchannel_batch(grpc_call_element*, grpc_transport_stream_op_batch*      +8  +2.1%
  +3.5%    +160 src/core/ext/filters/http/server/http_server_filter.cc                                  +160  +3.5%
      +138%    +149 hs_init_call_elem                                                                       +149  +138%
       +12%     +11 [Unmapped]                                                                               +11   +12%
  +4.7%    +152 src/core/lib/security/transport/client_auth_filter.cc                                   +152  +4.7%
       +84%    +113 init_call_elem                                                                          +113   +84%
      +4.0%     +24 auth_start_transport_stream_op_batch                                                     +24  +4.0%
      +2.0%     +16 on_host_checked                                                                          +16  +2.0%
  +2.7%    +144 src/core/ext/filters/http/client/http_client_filter.cc                                  +144  +2.7%
      +110%    +150 init_call_elem                                                                          +150  +110%
  +0.8%    +128 src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc                          +128  +0.8%
      +3.2%     +33 grpc_core::(anonymous namespace)::GrpcLbFactory::CreateLoadBalancingPolicy(grpc_core     +33  +3.2%
      +2.0%     +32 grpc_core::(anonymous namespace)::GrpcLb::StartBalancerCallLocked                        +32  +2.0%
      +0.9%     +16 grpc_core::(anonymous namespace)::GrpcLb::CreateOrUpdateRoundRobinPolicyLocked() [cl     +16  +0.9%
      +4.3%     +16 grpc_core::(anonymous namespace)::GrpcLb::~GrpcLb                                        +16  +4.3%
      +9.2%     +11 grpc_core::(anonymous namespace)::GrpcLb::BalancerCallState::ScheduleNextClientLoadR     +11  +9.2%
      +6.1%     +11 grpc_core::(anonymous namespace)::GrpcLb::StartPickingLocked                             +11  +6.1%
      +2.6%      +8 grpc_core::(anonymous namespace)::GrpcLb::PickLocked                                      +8  +2.6%
      +1.4%      +8 grpc_core::(anonymous namespace)::GrpcLb::BalancerCallState::SendClientLoadReportLoc      +8  +1.4%
  +0.8%    +128 src/core/ext/filters/client_channel/lb_policy/xds/xds.cc                                +128  +0.8%
      +3.2%     +33 grpc_core::(anonymous namespace)::XdsFactory::CreateLoadBalancingPolicy(grpc_core::L     +33  +3.2%
      +2.0%     +32 grpc_core::(anonymous namespace)::XdsLb::StartBalancerCallLocked                         +32  +2.0%
      +0.9%     +16 grpc_core::(anonymous namespace)::XdsLb::CreateOrUpdateRoundRobinPolicyLocked() [clo     +16  +0.9%
      +4.3%     +16 grpc_core::(anonymous namespace)::XdsLb::~XdsLb                                          +16  +4.3%
      +9.2%     +11 grpc_core::(anonymous namespace)::XdsLb::BalancerCallState::ScheduleNextClientLoadRe     +11  +9.2%
      +6.1%     +11 grpc_core::(anonymous namespace)::XdsLb::StartPickingLocked                              +11  +6.1%
      +2.6%      +8 grpc_core::(anonymous namespace)::XdsLb::PickLocked                                       +8  +2.6%
      +1.4%      +8 grpc_core::(anonymous namespace)::XdsLb::BalancerCallState::SendClientLoadReportLock      +8  +1.4%
  +4.8%    +128 src/core/lib/security/transport/server_auth_filter.cc                                   +128  +4.8%
       +85%    +121 init_call_elem                                                                          +121   +85%
      +1.1%      +8 recv_initial_metadata_ready                                                               +8  +1.1%
  +0.8%    +128 src/core/lib/surface/server.cc                                                          +128  +0.8%
      +7.3%     +24 [Unmapped]                                                                               +24  +7.3%
       +11%     +22 init_call_elem                                                                           +22   +11%
      +6.6%     +19 finish_start_new_rpc                                                                     +19  +6.6%
      +5.1%     +17 accept_stream                                                                            +17  +5.1%
      +2.7%     +16 publish_new_rpc                                                                          +16  +2.7%
      +2.3%     +11 queue_call_request                                                                       +11  +2.3%
      +8.1%     +11 request_matcher_zombify_all_pending_calls((anonymous namespace)::request_matcher*) [     +11  +8.1%
      +3.9%      +8 init_channel_elem                                                                         +8  +3.9%
      +0.9%      +8 grpc_server_shutdown_and_notify                                                           +8  +0.9%
      +1.4%      +8 grpc_server_start                                                                         +8  +1.4%
  +1.2%     +96 src/core/ext/filters/client_channel/subchannel.cc                                        +96  +1.2%
      +7.0%     +18 [Unmapped]                                                                               +18  +7.0%
      +1.1%     +16 grpc_subchannel_create                                                                   +16  +1.1%
      +5.0%     +16 grpc_core::ConnectedSubchannel::CreateCall                                               +16  +5.0%
      +4.0%     +14 maybe_start_connecting_locked                                                            +14  +4.0%
      +8.0%      +8 grpc_subchannel_weak_unref                                                                +8  +8.0%
      +3.7%      +8 grpc_subchannel_call_process_op                                                           +8  +3.7%
      +2.8%      +8 grpc_subchannel_notify_on_state_change                                                    +8  +2.8%
      +0.8%      +8 on_subchannel_connected                                                                   +8  +0.8%
  +0.6%     +96 src/core/ext/transport/inproc/inproc_transport.cc                                        +96  +0.6%
      +8.8%     +85 init_stream                                                                              +85  +8.8%
      +0.6%     +16 perform_stream_op                                                                        +16  +0.6%
  +3.7%     +80 src/core/ext/filters/deadline/deadline_filter.cc                                         +80  +3.7%
       +28%     +32 grpc_deadline_state_init                                                                 +32   +28%
      +6.5%     +16 server_start_transport_stream_op_batch                                                   +16  +6.5%
      +7.7%      +8 grpc_deadline_state_client_start_transport_stream_op_batch                                +8  +7.7%
      +3.0%      +8 timer_callback                                                                            +8  +3.0%
      +3.2%      +8 start_timer_if_needed(grpc_call_element*, long) [clone .part.2]                           +8  +3.2%
      +6.7%      +8 send_cancel_op_in_call_combiner                                                           +8  +6.7%
  +2.8%     +80 src/core/ext/filters/max_age/max_age_filter.cc                                           +80  +2.8%
      +8.9%     +72 init_channel_elem                                                                        +72  +8.9%
      +5.9%      +8 [Unmapped]                                                                                +8  +5.9%
  +1.0%     +80 src/core/lib/iomgr/resource_quota.cc                                                     +80  +1.0%
      +9.7%     +48 grpc_resource_user_create                                                                +48  +9.7%
      +8.7%     +24 grpc_resource_quota_create                                                               +24  +8.7%
       +35%     +16 grpc_resource_user_slice_allocator_init                                                  +16   +35%
      +7.1%      +8 grpc_resource_user_shutdown                                                               +8  +7.1%
      +2.5%      +8 grpc_resource_quota_resize                                                                +8  +2.5%
  +1.3%     +80 src/core/lib/iomgr/udp_server.cc                                                         +80  +1.3%
       +10%     +25 GrpcUdpListener::StartListening                                                          +25   +10%
       +11%     +22 GrpcUdpListener::OnFdAboutToOrphan                                                       +22   +11%
      +7.5%     +16 GrpcUdpListener::OnRead                                                                  +16  +7.5%
      +7.9%     +16 GrpcUdpListener::do_write                                                                +16  +7.9%
      +9.5%     +11 GrpcUdpListener::OrphanFd                                                                +11  +9.5%
      +4.5%      +8 GrpcUdpListener::OnCanWrite                                                               +8  +4.5%
  +1.9%     +64 src/core/ext/filters/http/message_compress/message_compress_filter.cc                    +64  +1.9%
       +52%     +76 init_call_elem                                                                           +76   +52%
  +0.9%     +64 src/core/lib/iomgr/tcp_posix.cc                                                          +64  +0.9%
      +1.8%     +16 grpc_tcp_create                                                                          +16  +1.8%
      +3.5%     +16 run_poller                                                                               +16  +3.5%
      +3.2%     +16 notify_on_write                                                                          +16  +3.2%
       +10%     +11 notify_on_read                                                                           +11   +10%
      +2.8%      +5 [Unmapped]                                                                                +5  +2.8%
  +7.8%     +48 src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc     +48  +7.8%
       +23%     +34 init_call_elem                                                                           +34   +23%
       +13%     +16 start_transport_stream_op_batch                                                          +16   +13%
  +0.9%     +48 src/core/ext/filters/message_size/message_size_filter.cc                                 +48  +0.9%
      +8.1%     +40 init_call_elem                                                                           +40  +8.1%
      +4.8%      +8 [Unmapped]                                                                                +8  +4.8%

 -------------- SHRINKING                                                                            --------------
  -0.0%     -42 [None]                                                                               -5.47Ki  -0.1%
  -7.8%     -22 src/core/lib/gpr/arena.cc                                                                -22  -7.8%
     -17.9%     -22 gpr_arena_alloc                                                                          -22 -17.9%
     -15.0%      -3 [Unmapped]                                                                                -3 -15.0%

  +0.3% +4.77Ki TOTAL                                                                                   -680  -0.0%


****************************************************************

libgrpc++.so

     VM SIZE              FILE SIZE
 ++++++++++++++ GROWIN ++++++++++++++

 -------------- SHRINK --------------
  [ = ]       0 [None]    -232  -0.0%

  [ = ]       0 TOTAL     -232  -0.0%



@grpc-testing
Copy link
Copy Markdown

[trickle] No significant performance differences

@grpc-testing
Copy link
Copy Markdown

Objective-C binary sizes
*****************STATIC******************
  New size                      Old size
   711,816       Core (>)        710,680

 1,998,398      Total (>)      1,997,238

***************FRAMEWORKS****************
  New size                      Old size
11,021,761      Total (<)     11,021,765

 No significant differences in binary sizes


@grpc-testing
Copy link
Copy Markdown

Corrupt JSON data (indicates timeout or crash): 
    bm_call_create.BM_IsolatedFilter_ClientChannelFilter_NoOp_.counters.new: 10
    bm_call_create.BM_IsolatedFilter_ClientChannelFilter_NoOp_.counters.old: 10


[microbenchmarks] Performance differences noted:
Benchmark                                                                            allocs_per_iteration    cpu_time    real_time
-----------------------------------------------------------------------------------  ----------------------  ----------  -----------
BM_HasClearGrpcStatus<ErrorWithGrpcStatus>                                                                   +5%         +5%
BM_HpackParserParseHeader<AddIndexedSingleInternedElem, UnrefHeader>                                         -52%        -52%
BM_HpackParserParseHeader<AddIndexedSingleStaticElem, UnrefHeader>                                           -69%        -69%
BM_HpackParserParseHeader<EmptyBatch, UnrefHeader>                                                           -96%        -96%
BM_HpackParserParseHeader<IndexedSingleInternedElem, UnrefHeader>                                            -88%        -88%
BM_HpackParserParseHeader<IndexedSingleStaticElem, UnrefHeader>                                              -93%        -93%
BM_HpackParserParseHeader<KeyIndexedSingleInternedElem, UnrefHeader>                                         -63%        -63%
BM_HpackParserParseHeader<KeyIndexedSingleStaticElem, UnrefHeader>                                           -63%        -63%
BM_HpackParserParseHeader<MoreRepresentativeClientInitialMetadata, OnInitialHeader>                          -16%        -16%
BM_HpackParserParseHeader<MoreRepresentativeClientInitialMetadata, UnrefHeader>                              -10%        -10%
BM_HpackParserParseHeader<NonIndexedBinaryElem<1, false>, UnrefHeader>                                       -59%        -59%
BM_HpackParserParseHeader<NonIndexedBinaryElem<1, true>, UnrefHeader>                                        -60%        -60%
BM_HpackParserParseHeader<NonIndexedBinaryElem<10, false>, UnrefHeader>                                      -45%        -45%
BM_HpackParserParseHeader<NonIndexedBinaryElem<10, true>, UnrefHeader>                                       -60%        -60%
BM_HpackParserParseHeader<NonIndexedBinaryElem<100, true>, UnrefHeader>                                      -56%        -56%
BM_HpackParserParseHeader<NonIndexedBinaryElem<3, false>, UnrefHeader>                                       -54%        -54%
BM_HpackParserParseHeader<NonIndexedBinaryElem<3, true>, UnrefHeader>                                        -61%        -61%
BM_HpackParserParseHeader<NonIndexedBinaryElem<31, false>, UnrefHeader>                                      -23%        -23%
BM_HpackParserParseHeader<NonIndexedBinaryElem<31, true>, UnrefHeader>                                       -57%        -57%
BM_HpackParserParseHeader<NonIndexedElem, UnrefHeader>                                                       -63%        -63%
BM_HpackParserParseHeader<RepresentativeClientInitialMetadata, OnInitialHeader>                              -36%        -36%
BM_HpackParserParseHeader<RepresentativeClientInitialMetadata, UnrefHeader>                                  -66%        -66%
BM_HpackParserParseHeader<RepresentativeServerInitialMetadata, OnInitialHeader>                              -63%        -63%
BM_HpackParserParseHeader<RepresentativeServerInitialMetadata, UnrefHeader>                                  -86%        -86%
BM_HpackParserParseHeader<RepresentativeServerTrailingMetadata, UnrefHeader>                                 -85%        -85%
BM_HpackParserParseHeader<SameDeadline, OnHeaderTimeout>                                                     -74%        -74%
BM_IsolatedFilter<ClientChannelFilter, NoOp>                                                                 +37%        +37%
BM_IsolatedFilter<HttpServerFilter, NoOp>                                                                    +6%         +6%
BM_LameChannelCallCreateCore                                                         -6%
BM_LameChannelCallCreateCoreSeparateBatch                                            -5%
BM_LameChannelCallCreateCpp                                                          -5%
BM_MetadataRefUnrefExternal                                                                                  -21%        -21%

const grpc_call_element_args* args) {
call_data* calld = static_cast<call_data*>(elem->call_data);
calld->call_combiner = args->call_combiner;
calld->recv_initial_metadata = nullptr;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't know if it makes a perf difference, but a lot of these fields will never be read until after they are set in hc_start_transport_stream_op_batch, so even these initializations might not be needed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you @ncteisen for the review. I had removed the ones that show up in profiles (most notably closures and mdelem fields) but, certainly, let me take another stab at it and remove more of these unnecessary initialization. I will hopefully upload another commit by tomorrow morning to remove the remaining unnecessary ones.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It is also something we could do in a separate PR, to make the overall changes smaller in size

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, great point on the size and safety. Please allow me to give it another shot this afternoon, and I will post the results here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

PTAL. :-) Thanks

/* one ref is for destroy */
gpr_ref_init(&t->refs, 1);
t->combiner = grpc_combiner_create();
t->ep = ep;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could leave a comment somewhere in this functions that these initializations should occur in the same order as the fields are in the struct itself?

const grpc_call_element_args* args) {
call_data* calld = static_cast<call_data*>(elem->call_data);
calld->call_combiner = args->call_combiner;
calld->recv_initial_metadata = nullptr;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Some of these fields are never read until they are set in hc_start_transport_stream_op_batch, is it worth considering perf impact of leaving them uninitialized till then?

Same comment for all the cases where we can gaurantee a field will be set before it's read

@thelinuxfoundation
Copy link
Copy Markdown

Thank you for your pull request. Before we can look at your contribution, we need to ensure all contributors are covered by a Contributor License Agreement.

After the following items are addressed, please respond with a new comment here, and the automated system will re-verify.

Regards,
CLA GitHub bot

Copy link
Copy Markdown
Contributor Author

@soheilhy soheilhy left a comment

Choose a reason for hiding this comment

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

Reviewable status: 3 of 28 files reviewed, 19 unresolved discussions (waiting on @markdroth, @soheilhy, @ncteisen, @yang-g, @AspirinSJL, @yashykt, @vjpai, and @apolcyn)


src/core/ext/filters/client_channel/client_channel.cc, line 3173 at r1 (raw file):

Previously, soheilhy (Soheil Hassas Yeganeh) wrote…

I made a pass through all initialization and reorder them to match the definition order of fields. As I mentioned grpc_call is tricky and I would like to send a follow up patch to reorder the fields to make them more cache friendly.

P.S. there are a few additional changes from error = nullptr to error = GRPC_ERROR_NONE in the original code, and a few initializations of booleans using false/true instead of previously 0/1.

PTAL. Thank you

As promised I added proper C++ ctor and dtor. PTAL :-)

Also, as mentioned grpc_call is a bit more than ctor/dtor but the rest have proper C++ initialization now.

Copy link
Copy Markdown
Contributor Author

@soheilhy soheilhy left a comment

Choose a reason for hiding this comment

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

Reviewable status: 3 of 28 files reviewed, 19 unresolved discussions (waiting on @markdroth, @ncteisen, @soheilhy, @yang-g, @AspirinSJL, @yashykt, @vjpai, and @apolcyn)


src/core/ext/transport/chttp2/transport/chttp2_transport.cc, line 488 at r3 (raw file):

Previously, ncteisen (Noah Eisen) wrote…

Could leave a comment somewhere in this functions that these initializations should occur in the same order as the fields are in the struct itself?

Noah I made this all C++. So, PTAL. It's a bit different (in a good way) now.

@grpc-testing
Copy link
Copy Markdown

Objective-C binary sizes
*****************STATIC******************
  New size                      Old size
   729,063       Core (>)        725,208

 2,018,280      Total (>)      2,014,173

***************FRAMEWORKS****************
  New size                      Old size
 3,913,466       Core (>)      3,906,738

11,120,204      Total (>)     11,113,470


@grpc-testing
Copy link
Copy Markdown

****************************************************************

libgrpc.so

     VM SIZE                                                                                            FILE SIZE
 ++++++++++++++ GROWING                                                                              ++++++++++++++
  +0.2% +1.45Ki [None]                                                                               +61.4Ki  +0.6%
      +0.2% +1.39Ki [Unmapped]                                                                           +61.4Ki  +0.6%
      [NEW]     +80 (anonymous namespace)::inproc_vtable                                                     +80  [NEW]
      +5.3%     +56 [None]                                                                                     0  [ = ]
      [NEW]     +32 (anonymous namespace)::g_empty_slice                                                       0  [ = ]
      [NEW]     +32 (anonymous namespace)::g_fake_auth_key                                                     0  [ = ]
      [NEW]     +32 (anonymous namespace)::g_fake_path_key                                                     0  [ = ]
      [NEW]     +32 (anonymous namespace)::g_fake_auth_value                                                   0  [ = ]
      [NEW]     +32 (anonymous namespace)::g_fake_path_value                                                   0  [ = ]
      [NEW]     +32 add_retriable_send_initial_metadata_op((anonymous namespace)::call_data*, (anonymous     +32  [NEW]
      [NEW]      +4 (anonymous namespace)::g_init_strategy                                                     0  [ = ]
      [NEW]      +4 (anonymous namespace)::g_init_strategy_once                                                0  [ = ]
  +4.8% +1.55Ki src/core/ext/transport/chttp2/transport/chttp2_transport.cc                          +1.55Ki  +4.8%
      [NEW] +4.00Ki grpc_chttp2_transport::grpc_chttp2_transport                                         +4.00Ki  [NEW]
      [NEW] +1.10Ki grpc_chttp2_stream::grpc_chttp2_stream                                               +1.10Ki  [NEW]
      [NEW] +1.06Ki grpc_chttp2_stream::~grpc_chttp2_stream                                              +1.06Ki  [NEW]
      [NEW]    +735 grpc_chttp2_transport::~grpc_chttp2_transport                                           +735  [NEW]
      [NEW]    +359 try_http_parsing(grpc_chttp2_transport*) [clone .isra.6]                                +359  [NEW]
      [NEW]    +281 removal_error(grpc_error*, grpc_chttp2_stream*, char const*) [clone .isra.7]            +281  [NEW]
      [NEW]     +46 post_destructive_reclaimer(grpc_chttp2_transport*) [clone .part.31]                      +46  [NEW]
      [NEW]     +43 post_benign_reclaimer(grpc_chttp2_transport*) [clone .part.32]                           +43  [NEW]
      +3.7%     +16 write_action_end_locked                                                                  +16  +3.7%
      +0.5%     +16 perform_stream_op_locked                                                                 +16  +0.5%
      +3.2%     +16 write_action_begin_locked                                                                +16  +3.2%
      +7.5%     +11 grpc_chttp2_initiate_write                                                               +11  +7.5%
       +16%     +11 write_action                                                                             +11   +16%
      +7.6%     +11 perform_transport_op                                                                     +11  +7.6%
       +20%     +11 grpc_core::Chttp2IncomingByteStream::Orphan                                              +11   +20%
      +1.3%      +9 [Unmapped]                                                                                +9  +1.3%
      +6.7%      +8 destroy_stream                                                                            +8  +6.7%
      +9.4%      +8 destroy_transport                                                                         +8  +9.4%
      +2.4%      +8 perform_stream_op                                                                         +8  +2.4%
      +7.9%      +8 grpc_core::Chttp2IncomingByteStream::Next                                                 +8  +7.9%
  +2.6%    +992 src/core/ext/filters/client_channel/client_channel.cc                                   +992  +2.6%
      [NEW] +2.12Ki run_closures_for_completed_call                                                      +2.12Ki  [NEW]
      [NEW] +1.45Ki maybe_retry                                                                          +1.45Ki  [NEW]
      [NEW]    +397 add_closure_for_subchannel_batch(grpc_call_element*, grpc_transport_stream_op_batch*    +397  [NEW]
      [NEW]    +352 add_retriable_send_initial_metadata_op                                                  +352  [NEW]
       +37%    +320 pick_done                                                                               +320   +37%
      +107%    +287 cc_init_call_elem                                                                       +287  +107%
      [NEW]    +256 retry_commit                                                                            +256  [NEW]
      [NEW]    +250 maybe_clear_pending_batch(grpc_call_element*, (anonymous namespace)::pending_batch*)    +250  [NEW]
      [NEW]    +192 add_retriable_send_message_op(grpc_call_element*, (anonymous namespace)::subchannel_    +192  [NEW]
      [NEW]    +189 batch_data_unref                                                                        +189  [NEW]
      +2.6%    +134 [Other]                                                                                 +134  +2.6%
      [NEW]    +110 free_cached_send_message                                                                +110  [NEW]
      [NEW]     +67 free_cached_send_initial_metadata                                                        +67  [NEW]
      [NEW]     +67 free_cached_send_trailing_metadata                                                       +67  [NEW]
      +1.3%     +64 on_resolver_result_changed_locked                                                        +64  +1.3%
      +1.3%     +48 start_retriable_subchannel_batches                                                       +48  +1.3%
      +2.4%     +32 cc_init_channel_elem                                                                     +32  +2.4%
      +6.1%     +32 cc_destroy_channel_elem                                                                  +32  +6.1%
      +2.0%     +32 start_transport_op_locked                                                                +32  +2.0%
       +15%     +25 batch_data_create                                                                        +25   +15%
       +13%     +21 grpc_client_channel_watch_connectivity_state                                             +21   +13%
  +5.8%    +928 src/core/lib/surface/call.cc                                                            +928  +5.8%
       +38%    +736 grpc_call_create                                                                        +736   +38%
      [NEW]    +476 set_encodings_accepted_by_peer(grpc_call*, grpc_mdelem, unsigned int*, bool) [clone     +476  [NEW]
      [NEW]    +259 publish_app_metadata(grpc_call*, grpc_metadata_batch*, int) [clone .isra.3]             +259  [NEW]
      +4.2%    +144 call_start_batch                                                                        +144  +4.2%
      [NEW]     +47 get_md_elem(grpc_metadata*, grpc_metadata*, int, int) [clone .part.2]                    +47  [NEW]
      +9.1%     +16 grpc_call_set_completion_queue                                                           +16  +9.1%
       +23%     +16 release_call                                                                             +16   +23%
      +7.2%     +16 cancel_with_error                                                                        +16  +7.2%
      +3.3%     +16 receiving_stream_ready                                                                   +16  +3.3%
      +1.0%     +16 receiving_initial_metadata_ready                                                         +16  +1.0%
      +2.3%      +8 destroy_call                                                                              +8  +2.3%
  +0.7%    +895 [Other]                                                                                 +895  +0.7%
  +4.4%    +656 src/core/ext/transport/inproc/inproc_transport.cc                                       +656  +4.4%
      [NEW] +3.53Ki (anonymous namespace)::op_state_machine                                              +3.53Ki  [NEW]
      [NEW] +2.53Ki (anonymous namespace)::perform_stream_op                                             +2.53Ki  [NEW]
      [NEW] +1.72Ki (anonymous namespace)::fail_helper_locked                                            +1.72Ki  [NEW]
      [NEW] +1.28Ki (anonymous namespace)::init_stream                                                   +1.28Ki  [NEW]
      [NEW]    +854 (anonymous namespace)::cancel_stream_locked                                             +854  [NEW]
      [NEW]    +604 (anonymous namespace)::message_transfer_locked                                          +604  [NEW]
      [NEW]    +471 (anonymous namespace)::destroy_transport                                                +471  [NEW]
      [NEW]    +437 (anonymous namespace)::destroy_stream                                                   +437  [NEW]
      [NEW]    +329 (anonymous namespace)::close_transport_locked                                           +329  [NEW]
      [NEW]    +321 (anonymous namespace)::fill_in_metadata((anonymous namespace)::inproc_stream*, grpc_    +321  [NEW]
      [NEW]    +257 (anonymous namespace)::close_stream_locked((anonymous namespace)::inproc_stream*) [c    +257  [NEW]
      [NEW]    +257 (anonymous namespace)::perform_transport_op                                             +257  [NEW]
      [NEW]    +242 (anonymous namespace)::complete_if_batch_end_locked                                     +242  [NEW]
      [NEW]    +219 (anonymous namespace)::log_metadata                                                     +219  [NEW]
      [NEW]    +123 (anonymous namespace)::close_other_side_locked((anonymous namespace)::inproc_stream*    +123  [NEW]
      [NEW]     +96 (anonymous namespace)::maybe_schedule_op_closure_locked((anonymous namespace)::inpro     +96  [NEW]
      +8.3%     +55 grpc_inproc_channel_create                                                               +55  +8.3%
      [NEW]      +3 (anonymous namespace)::get_endpoint                                                       +3  [NEW]
      [NEW]      +2 [Other]                                                                                   +2  [NEW]
      [NEW]      +2 (anonymous namespace)::do_nothing                                                         +2  [NEW]
      [NEW]      +2 (anonymous namespace)::set_pollset                                                        +2  [NEW]
  +5.8%    +448 src/core/ext/filters/client_channel/health/health_check_client.cc                       +448  +5.8%
      +129%    +325 grpc_core::HealthCheckClient::CallState::CallState                                      +325  +129%
      +3.1%     +48 grpc_core::HealthCheckClient::CallState::StartCall                                       +48  +3.1%
       +11%     +24 [Unmapped]                                                                               +24   +11%
       +12%     +16 grpc_core::HealthCheckClient::CallState::RecvMessageReady                                +16   +12%
      +1.3%     +16 grpc_core::HealthCheckClient::CallState::DoneReadingRecvMessage                          +16  +1.3%
      +2.9%     +11 grpc_core::HealthCheckClient::HealthCheckClient                                          +11  +2.9%
       +13%      +8 grpc_core::HealthCheckClient::CallState::StartBatch                                       +8   +13%
      +7.4%      +8 grpc_core::HealthCheckClient::CallState::StartCancel                                      +8  +7.4%
      +7.0%      +8 grpc_core::HealthCheckClient::CallState::Cancel                                           +8  +7.0%
   +99%    +280 src/core/lib/gpr/arena.cc                                                               +280   +99%
      [NEW]    +150 set_strategy_from_env                                                                   +150  [NEW]
      [NEW]    +108 gpr_arena_alloc_maybe_init                                                              +108  [NEW]
      [NEW]     +19 gpr_arena_init                                                                           +19  [NEW]
       +45%      +9 [Unmapped]                                                                                +9   +45%
      +6.8%      +5 gpr_arena_create                                                                          +5  +6.8%
  +4.0%    +208 src/core/ext/filters/http/client/http_client_filter.cc                                  +208  +4.0%
      +156%    +212 init_call_elem                                                                          +212  +156%
  +5.2%    +168 src/core/lib/security/transport/client_auth_filter.cc                                   +168  +5.2%
       +98%    +132 init_call_elem                                                                          +132   +98%
      +4.0%     +24 auth_start_transport_stream_op_batch                                                     +24  +4.0%
      +2.0%     +16 on_host_checked                                                                          +16  +2.0%
  +1.0%    +160 src/core/lib/surface/server.cc                                                          +160  +1.0%
      +9.6%     +32 [Unmapped]                                                                               +32  +9.6%
       +11%     +22 init_call_elem                                                                           +22   +11%
      +6.6%     +19 finish_start_new_rpc                                                                     +19  +6.6%
      +5.1%     +17 accept_stream                                                                            +17  +5.1%
      +2.7%     +16 publish_new_rpc                                                                          +16  +2.7%
      +1.7%     +16 grpc_server_shutdown_and_notify                                                          +16  +1.7%
      +2.3%     +11 queue_call_request                                                                       +11  +2.3%
      +8.1%     +11 request_matcher_zombify_all_pending_calls((anonymous namespace)::request_matcher*) [     +11  +8.1%
      +3.9%      +8 init_channel_elem                                                                         +8  +3.9%
      +1.4%      +8 grpc_server_start                                                                         +8  +1.4%
  +3.9%    +130 src/core/ext/filters/http/message_compress/message_compress_filter.cc                   +130  +3.9%
       +95%    +138 init_call_elem                                                                          +138   +95%
  +0.8%    +128 src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc                          +128  +0.8%
      +3.2%     +33 grpc_core::(anonymous namespace)::GrpcLbFactory::CreateLoadBalancingPolicy(grpc_core     +33  +3.2%
      +2.0%     +32 grpc_core::(anonymous namespace)::GrpcLb::StartBalancerCallLocked                        +32  +2.0%
      +0.8%     +16 grpc_core::(anonymous namespace)::GrpcLb::CreateOrUpdateRoundRobinPolicyLocked() [cl     +16  +0.8%
      +4.3%     +16 grpc_core::(anonymous namespace)::GrpcLb::~GrpcLb                                        +16  +4.3%
      +9.2%     +11 grpc_core::(anonymous namespace)::GrpcLb::BalancerCallState::ScheduleNextClientLoadR     +11  +9.2%
      +6.1%     +11 grpc_core::(anonymous namespace)::GrpcLb::StartPickingLocked                             +11  +6.1%
      +2.6%      +8 grpc_core::(anonymous namespace)::GrpcLb::PickLocked                                      +8  +2.6%
      +1.4%      +8 grpc_core::(anonymous namespace)::GrpcLb::BalancerCallState::SendClientLoadReportLoc      +8  +1.4%
  +0.8%    +128 src/core/ext/filters/client_channel/lb_policy/xds/xds.cc                                +128  +0.8%
      +3.2%     +33 grpc_core::(anonymous namespace)::XdsFactory::CreateLoadBalancingPolicy(grpc_core::L     +33  +3.2%
      +2.0%     +32 grpc_core::(anonymous namespace)::XdsLb::StartBalancerCallLocked                         +32  +2.0%
      +0.9%     +16 grpc_core::(anonymous namespace)::XdsLb::CreateOrUpdateRoundRobinPolicyLocked() [clo     +16  +0.9%
      +4.3%     +16 grpc_core::(anonymous namespace)::XdsLb::~XdsLb                                          +16  +4.3%
      +9.2%     +11 grpc_core::(anonymous namespace)::XdsLb::BalancerCallState::ScheduleNextClientLoadRe     +11  +9.2%
      +6.1%     +11 grpc_core::(anonymous namespace)::XdsLb::StartPickingLocked                              +11  +6.1%
      +2.6%      +8 grpc_core::(anonymous namespace)::XdsLb::PickLocked                                       +8  +2.6%
      +1.4%      +8 grpc_core::(anonymous namespace)::XdsLb::BalancerCallState::SendClientLoadReportLock      +8  +1.4%
  +2.8%    +128 src/core/ext/filters/http/server/http_server_filter.cc                                  +128  +2.8%
      [NEW] +2.52Ki hs_filter_incoming_metadata(grpc_call_element*, grpc_metadata_batch*) [clone .isra.6 +2.52Ki  [NEW]
      +115%    +124 hs_init_call_elem                                                                       +124  +115%
      +4.5%      +4 [Unmapped]                                                                                +4  +4.5%
  +5.2%    +112 src/core/ext/filters/deadline/deadline_filter.cc                                        +112  +5.2%
      [NEW]    +261 start_timer_if_needed(grpc_call_element*, long) [clone .part.3]                         +261  [NEW]
      [NEW]    +146 grpc_deadline_state::grpc_deadline_state                                                +146  [NEW]
      [NEW]     +32 grpc_deadline_state::~grpc_deadline_state                                                +32  [NEW]
       +89%     +24 init_call_elem                                                                           +24   +89%
      +6.5%     +16 server_start_transport_stream_op_batch                                                   +16  +6.5%
      +7.7%      +8 grpc_deadline_state_client_start_transport_stream_op_batch                                +8  +7.7%
      +3.0%      +8 timer_callback                                                                            +8  +3.0%
      +6.7%      +8 send_cancel_op_in_call_combiner                                                           +8  +6.7%
       +80%      +4 destroy_call_elem                                                                         +4   +80%
      +1.3%      +2 [Unmapped]                                                                                +2  +1.3%
      +1.4%      +2 start_timer_after_init                                                                    +2  +1.4%
  +3.5%    +112 src/core/lib/security/context/security_context.cc                                       +112  +3.5%
      [NEW]     +50 grpc_client_security_context::~grpc_client_security_context                              +50  [NEW]
      +450%     +45 grpc_client_security_context_create                                                      +45  +450%
      [NEW]     +42 grpc_server_security_context::~grpc_server_security_context                              +42  [NEW]
      +370%     +37 grpc_server_security_context_create                                                      +37  +370%
       +16%     +27 [Unmapped]                                                                               +27   +16%
  +1.2%     +96 src/core/lib/iomgr/resource_quota.cc                                                     +96  +1.2%
      +9.7%     +48 grpc_resource_user_create                                                                +48  +9.7%
       +11%     +32 grpc_resource_quota_create                                                               +32   +11%
       +35%     +16 grpc_resource_user_slice_allocator_init                                                  +16   +35%
      +7.1%      +8 grpc_resource_user_shutdown                                                               +8  +7.1%
      +2.5%      +8 grpc_resource_quota_resize                                                                +8  +2.5%
  +0.9%     +88 src/core/ext/filters/client_channel/subchannel.cc                                        +88  +0.9%
      +7.7%     +24 grpc_core::ConnectedSubchannel::CreateCall                                               +24  +7.7%
      +0.9%     +16 grpc_subchannel_create                                                                   +16  +0.9%
      +1.0%     +16 on_subchannel_connected                                                                  +16  +1.0%
      +4.1%     +16 maybe_start_connecting_locked                                                            +16  +4.1%
      +8.0%      +8 grpc_subchannel_weak_unref                                                                +8  +8.0%
      +3.7%      +8 grpc_subchannel_call_process_op                                                           +8  +3.7%
  +2.8%     +80 src/core/ext/filters/max_age/max_age_filter.cc                                           +80  +2.8%
      +8.9%     +72 init_channel_elem                                                                        +72  +8.9%
      +5.9%      +8 [Unmapped]                                                                                +8  +5.9%
  +1.3%     +80 src/core/lib/iomgr/udp_server.cc                                                         +80  +1.3%
       +10%     +25 GrpcUdpListener::StartListening                                                          +25   +10%
       +11%     +22 GrpcUdpListener::OnFdAboutToOrphan                                                       +22   +11%
      +7.5%     +16 GrpcUdpListener::OnRead                                                                  +16  +7.5%
      +7.9%     +16 GrpcUdpListener::do_write                                                                +16  +7.9%
      +9.5%     +11 GrpcUdpListener::OrphanFd                                                                +11  +9.5%
      +4.5%      +8 GrpcUdpListener::OnCanWrite                                                               +8  +4.5%

 -------------- SHRINKING                                                                            --------------
 -17.7%     -64 src/core/ext/transport/chttp2/transport/incoming_metadata.cc                             -64 -17.7%
      [DEL]     -35 grpc_chttp2_incoming_metadata_buffer_init                                                -35  [DEL]
     -48.8%     -20 [Unmapped]                                                                               -20 -48.8%
      [DEL]      -9 grpc_chttp2_incoming_metadata_buffer_destroy                                              -9  [DEL]
  -1.4%     -52 src/core/lib/security/transport/secure_endpoint.cc                                       -52  -1.4%
      [DEL]    -256 call_read_cb                                                                            -256  [DEL]
      [DEL]    -221 flush_write_staging_buffer                                                              -221  [DEL]
      [DEL]    -151 destroy                                                                                 -151  [DEL]
     -87.8%     -36 endpoint_destroy                                                                         -36 -87.8%
      -5.2%     -20 grpc_secure_endpoint_create                                                              -20  -5.2%
  -1.0%     -32 src/core/ext/transport/chttp2/transport/frame_data.cc                                    -32  -1.0%
      [DEL]    -191 grpc_chttp2_data_parser_destroy                                                         -191  [DEL]
      [DEL]     -17 grpc_chttp2_data_parser_init                                                             -17  [DEL]
     -44.1%     -15 [Unmapped]                                                                               -15 -44.1%

  +0.6% +8.53Ki TOTAL                                                                                +68.5Ki  +0.6%


****************************************************************

libgrpc++.so

     VM SIZE              FILE SIZE
 ++++++++++++++ GROWIN ++++++++++++++
  [ = ]       0 [None]    +736  +0.0%

  [ = ]       0 TOTAL     +736  +0.0%



@grpc-testing
Copy link
Copy Markdown

[trickle] No significant performance differences

@grpc-testing
Copy link
Copy Markdown

Objective-C binary sizes
*****************STATIC******************
  New size                      Old size
   731,355       Core (>)        727,548

 2,020,596      Total (>)      2,016,505

***************FRAMEWORKS****************
  New size                      Old size
 3,974,206       Core (>)      3,916,346

11,180,948      Total (>)     11,123,084


@grpc-testing
Copy link
Copy Markdown

Corrupt JSON data (indicates timeout or crash): 
    bm_call_create.BM_IsolatedFilter_ClientChannelFilter_NoOp_.counters.new: 10
    bm_call_create.BM_IsolatedFilter_ClientChannelFilter_NoOp_.counters.old: 10


[microbenchmarks] Performance differences noted:
Benchmark                                                                            allocs_per_iteration    cpu_time    real_time
-----------------------------------------------------------------------------------  ----------------------  ----------  -----------
BM_HasClearGrpcStatus<ErrorWithGrpcStatus>                                                                   +9%         +9%
BM_HpackParserParseHeader<AddIndexedSingleInternedElem, UnrefHeader>                                         -50%        -50%
BM_HpackParserParseHeader<AddIndexedSingleStaticElem, UnrefHeader>                                           -70%        -70%
BM_HpackParserParseHeader<EmptyBatch, UnrefHeader>                                                           -96%        -96%
BM_HpackParserParseHeader<IndexedSingleInternedElem, UnrefHeader>                                            -88%        -88%
BM_HpackParserParseHeader<IndexedSingleStaticElem, UnrefHeader>                                              -92%        -92%
BM_HpackParserParseHeader<KeyIndexedSingleInternedElem, UnrefHeader>                                         -60%        -60%
BM_HpackParserParseHeader<KeyIndexedSingleStaticElem, UnrefHeader>                                           -57%        -57%
BM_HpackParserParseHeader<MoreRepresentativeClientInitialMetadata, OnInitialHeader>                          -17%        -17%
BM_HpackParserParseHeader<MoreRepresentativeClientInitialMetadata, UnrefHeader>                              -8%         -8%
BM_HpackParserParseHeader<NonIndexedBinaryElem<1, false>, UnrefHeader>                                       -56%        -56%
BM_HpackParserParseHeader<NonIndexedBinaryElem<1, true>, UnrefHeader>                                        -60%        -60%
BM_HpackParserParseHeader<NonIndexedBinaryElem<10, false>, UnrefHeader>                                      -41%        -41%
BM_HpackParserParseHeader<NonIndexedBinaryElem<10, true>, UnrefHeader>                                       -63%        -63%
BM_HpackParserParseHeader<NonIndexedBinaryElem<100, false>, UnrefHeader>                                     -4%         -4%
BM_HpackParserParseHeader<NonIndexedBinaryElem<100, true>, UnrefHeader>                                      -59%        -59%
BM_HpackParserParseHeader<NonIndexedBinaryElem<3, false>, UnrefHeader>                                       -55%        -55%
BM_HpackParserParseHeader<NonIndexedBinaryElem<3, true>, UnrefHeader>                                        -59%        -59%
BM_HpackParserParseHeader<NonIndexedBinaryElem<31, false>, UnrefHeader>                                      -27%        -27%
BM_HpackParserParseHeader<NonIndexedBinaryElem<31, true>, UnrefHeader>                                       -57%        -57%
BM_HpackParserParseHeader<NonIndexedElem, UnrefHeader>                                                       -56%        -56%
BM_HpackParserParseHeader<RepresentativeClientInitialMetadata, OnInitialHeader>                              -29%        -29%
BM_HpackParserParseHeader<RepresentativeClientInitialMetadata, UnrefHeader>                                  -65%        -65%
BM_HpackParserParseHeader<RepresentativeServerInitialMetadata, OnInitialHeader>                              -58%        -58%
BM_HpackParserParseHeader<RepresentativeServerInitialMetadata, UnrefHeader>                                  -86%        -86%
BM_HpackParserParseHeader<RepresentativeServerTrailingMetadata, UnrefHeader>                                 -82%        -82%
BM_HpackParserParseHeader<SameDeadline, OnHeaderTimeout>                                                     -70%        -70%
BM_IsolatedFilter<HttpServerFilter, NoOp>                                                                    +7%         +7%
BM_LameChannelCallCreateCore                                                         -6%
BM_LameChannelCallCreateCoreSeparateBatch                                            -5%
BM_LameChannelCallCreateCpp                                                          -5%
BM_WellFlushed                                                                                               +9%         +9%

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@ncteisen This one was caught by running all tests internally. PTAL.

@grpc-testing
Copy link
Copy Markdown

****************************************************************

libgrpc.so

     VM SIZE                                                                                            FILE SIZE
 ++++++++++++++ GROWING                                                                              ++++++++++++++
  +0.2% +1.46Ki [None]                                                                               +61.4Ki  +0.6%
      +0.2% +1.40Ki [Unmapped]                                                                           +61.4Ki  +0.6%
      [NEW]     +80 (anonymous namespace)::inproc_vtable                                                     +80  [NEW]
      +5.3%     +56 [None]                                                                                     0  [ = ]
      [NEW]     +32 (anonymous namespace)::g_empty_slice                                                       0  [ = ]
      [NEW]     +32 (anonymous namespace)::g_fake_auth_key                                                     0  [ = ]
      [NEW]     +32 (anonymous namespace)::g_fake_path_key                                                     0  [ = ]
      [NEW]     +32 (anonymous namespace)::g_fake_auth_value                                                   0  [ = ]
      [NEW]     +32 (anonymous namespace)::g_fake_path_value                                                   0  [ = ]
      [NEW]     +32 add_retriable_send_initial_metadata_op((anonymous namespace)::call_data*, (anonymous     +32  [NEW]
      [NEW]      +4 (anonymous namespace)::g_init_strategy                                                     0  [ = ]
      [NEW]      +4 (anonymous namespace)::g_init_strategy_once                                                0  [ = ]
  +4.8% +1.56Ki src/core/ext/transport/chttp2/transport/chttp2_transport.cc                          +1.56Ki  +4.8%
      [NEW] +4.00Ki grpc_chttp2_transport::grpc_chttp2_transport                                         +4.00Ki  [NEW]
      [NEW] +1.10Ki grpc_chttp2_stream::grpc_chttp2_stream                                               +1.10Ki  [NEW]
      [NEW] +1.06Ki grpc_chttp2_stream::~grpc_chttp2_stream                                              +1.06Ki  [NEW]
      [NEW]    +735 grpc_chttp2_transport::~grpc_chttp2_transport                                           +735  [NEW]
      [NEW]    +359 try_http_parsing(grpc_chttp2_transport*) [clone .isra.6]                                +359  [NEW]
      [NEW]    +281 removal_error(grpc_error*, grpc_chttp2_stream*, char const*) [clone .isra.7]            +281  [NEW]
      [NEW]     +46 post_destructive_reclaimer(grpc_chttp2_transport*) [clone .part.31]                      +46  [NEW]
      [NEW]     +43 post_benign_reclaimer(grpc_chttp2_transport*) [clone .part.32]                           +43  [NEW]
      +3.7%     +16 write_action_end_locked                                                                  +16  +3.7%
      +0.5%     +16 perform_stream_op_locked                                                                 +16  +0.5%
      +3.2%     +16 write_action_begin_locked                                                                +16  +3.2%
      +2.9%     +16 init_keepalive_ping_locked                                                               +16  +2.9%
      +7.5%     +11 grpc_chttp2_initiate_write                                                               +11  +7.5%
       +16%     +11 write_action                                                                             +11   +16%
      +7.6%     +11 perform_transport_op                                                                     +11  +7.6%
       +20%     +11 grpc_core::Chttp2IncomingByteStream::Orphan                                              +11   +20%
      +1.3%      +9 [Unmapped]                                                                                +9  +1.3%
      +7.9%      +8 [Other]                                                                                   +8  +7.9%
      +6.7%      +8 destroy_stream                                                                            +8  +6.7%
      +9.4%      +8 destroy_transport                                                                         +8  +9.4%
      +2.4%      +8 perform_stream_op                                                                         +8  +2.4%
  +2.6%    +992 src/core/ext/filters/client_channel/client_channel.cc                                   +992  +2.6%
      [NEW] +2.12Ki run_closures_for_completed_call                                                      +2.12Ki  [NEW]
      [NEW] +1.45Ki maybe_retry                                                                          +1.45Ki  [NEW]
      [NEW]    +397 add_closure_for_subchannel_batch(grpc_call_element*, grpc_transport_stream_op_batch*    +397  [NEW]
      [NEW]    +352 add_retriable_send_initial_metadata_op                                                  +352  [NEW]
       +37%    +320 pick_done                                                                               +320   +37%
      +107%    +287 cc_init_call_elem                                                                       +287  +107%
      [NEW]    +256 retry_commit                                                                            +256  [NEW]
      [NEW]    +250 maybe_clear_pending_batch(grpc_call_element*, (anonymous namespace)::pending_batch*)    +250  [NEW]
      [NEW]    +192 add_retriable_send_message_op(grpc_call_element*, (anonymous namespace)::subchannel_    +192  [NEW]
      [NEW]    +189 batch_data_unref                                                                        +189  [NEW]
      +2.6%    +134 [Other]                                                                                 +134  +2.6%
      [NEW]    +110 free_cached_send_message                                                                +110  [NEW]
      [NEW]     +67 free_cached_send_initial_metadata                                                        +67  [NEW]
      [NEW]     +67 free_cached_send_trailing_metadata                                                       +67  [NEW]
      +1.3%     +64 on_resolver_result_changed_locked                                                        +64  +1.3%
      +1.3%     +48 start_retriable_subchannel_batches                                                       +48  +1.3%
      +2.4%     +32 cc_init_channel_elem                                                                     +32  +2.4%
      +6.1%     +32 cc_destroy_channel_elem                                                                  +32  +6.1%
      +2.0%     +32 start_transport_op_locked                                                                +32  +2.0%
       +15%     +25 batch_data_create                                                                        +25   +15%
       +13%     +21 grpc_client_channel_watch_connectivity_state                                             +21   +13%
  +5.8%    +928 src/core/lib/surface/call.cc                                                            +928  +5.8%
       +38%    +736 grpc_call_create                                                                        +736   +38%
      [NEW]    +476 set_encodings_accepted_by_peer(grpc_call*, grpc_mdelem, unsigned int*, bool) [clone     +476  [NEW]
      [NEW]    +259 publish_app_metadata(grpc_call*, grpc_metadata_batch*, int) [clone .isra.3]             +259  [NEW]
      +4.2%    +144 call_start_batch                                                                        +144  +4.2%
      [NEW]     +47 get_md_elem(grpc_metadata*, grpc_metadata*, int, int) [clone .part.2]                    +47  [NEW]
      +9.1%     +16 grpc_call_set_completion_queue                                                           +16  +9.1%
       +23%     +16 release_call                                                                             +16   +23%
      +7.2%     +16 cancel_with_error                                                                        +16  +7.2%
      +3.3%     +16 receiving_stream_ready                                                                   +16  +3.3%
      +1.0%     +16 receiving_initial_metadata_ready                                                         +16  +1.0%
      +2.3%      +8 destroy_call                                                                              +8  +2.3%
  +0.7%    +895 [Other]                                                                                 +895  +0.7%
  +4.4%    +656 src/core/ext/transport/inproc/inproc_transport.cc                                       +656  +4.4%
      [NEW] +3.53Ki (anonymous namespace)::op_state_machine                                              +3.53Ki  [NEW]
      [NEW] +2.53Ki (anonymous namespace)::perform_stream_op                                             +2.53Ki  [NEW]
      [NEW] +1.72Ki (anonymous namespace)::fail_helper_locked                                            +1.72Ki  [NEW]
      [NEW] +1.28Ki (anonymous namespace)::init_stream                                                   +1.28Ki  [NEW]
      [NEW]    +854 (anonymous namespace)::cancel_stream_locked                                             +854  [NEW]
      [NEW]    +604 (anonymous namespace)::message_transfer_locked                                          +604  [NEW]
      [NEW]    +471 (anonymous namespace)::destroy_transport                                                +471  [NEW]
      [NEW]    +437 (anonymous namespace)::destroy_stream                                                   +437  [NEW]
      [NEW]    +329 (anonymous namespace)::close_transport_locked                                           +329  [NEW]
      [NEW]    +321 (anonymous namespace)::fill_in_metadata((anonymous namespace)::inproc_stream*, grpc_    +321  [NEW]
      [NEW]    +257 (anonymous namespace)::close_stream_locked((anonymous namespace)::inproc_stream*) [c    +257  [NEW]
      [NEW]    +257 (anonymous namespace)::perform_transport_op                                             +257  [NEW]
      [NEW]    +242 (anonymous namespace)::complete_if_batch_end_locked                                     +242  [NEW]
      [NEW]    +219 (anonymous namespace)::log_metadata                                                     +219  [NEW]
      [NEW]    +123 (anonymous namespace)::close_other_side_locked((anonymous namespace)::inproc_stream*    +123  [NEW]
      [NEW]     +96 (anonymous namespace)::maybe_schedule_op_closure_locked((anonymous namespace)::inpro     +96  [NEW]
      +8.3%     +55 grpc_inproc_channel_create                                                               +55  +8.3%
      [NEW]      +3 (anonymous namespace)::get_endpoint                                                       +3  [NEW]
      [NEW]      +2 [Other]                                                                                   +2  [NEW]
      [NEW]      +2 (anonymous namespace)::do_nothing                                                         +2  [NEW]
      [NEW]      +2 (anonymous namespace)::set_pollset                                                        +2  [NEW]
  +5.8%    +448 src/core/ext/filters/client_channel/health/health_check_client.cc                       +448  +5.8%
      +129%    +325 grpc_core::HealthCheckClient::CallState::CallState                                      +325  +129%
      +3.1%     +48 grpc_core::HealthCheckClient::CallState::StartCall                                       +48  +3.1%
       +11%     +24 [Unmapped]                                                                               +24   +11%
       +12%     +16 grpc_core::HealthCheckClient::CallState::RecvMessageReady                                +16   +12%
      +1.3%     +16 grpc_core::HealthCheckClient::CallState::DoneReadingRecvMessage                          +16  +1.3%
      +2.9%     +11 grpc_core::HealthCheckClient::HealthCheckClient                                          +11  +2.9%
       +13%      +8 grpc_core::HealthCheckClient::CallState::StartBatch                                       +8   +13%
      +7.4%      +8 grpc_core::HealthCheckClient::CallState::StartCancel                                      +8  +7.4%
      +7.0%      +8 grpc_core::HealthCheckClient::CallState::Cancel                                           +8  +7.0%
   +99%    +280 src/core/lib/gpr/arena.cc                                                               +280   +99%
      [NEW]    +150 set_strategy_from_env                                                                   +150  [NEW]
      [NEW]    +108 gpr_arena_alloc_maybe_init                                                              +108  [NEW]
      [NEW]     +19 gpr_arena_init                                                                           +19  [NEW]
       +45%      +9 [Unmapped]                                                                                +9   +45%
      +6.8%      +5 gpr_arena_create                                                                          +5  +6.8%
  +4.0%    +208 src/core/ext/filters/http/client/http_client_filter.cc                                  +208  +4.0%
      +156%    +212 init_call_elem                                                                          +212  +156%
  +5.2%    +168 src/core/lib/security/transport/client_auth_filter.cc                                   +168  +5.2%
       +98%    +132 init_call_elem                                                                          +132   +98%
      +4.0%     +24 auth_start_transport_stream_op_batch                                                     +24  +4.0%
      +2.0%     +16 on_host_checked                                                                          +16  +2.0%
  +1.0%    +160 src/core/lib/surface/server.cc                                                          +160  +1.0%
      +9.6%     +32 [Unmapped]                                                                               +32  +9.6%
       +11%     +22 init_call_elem                                                                           +22   +11%
      +6.6%     +19 finish_start_new_rpc                                                                     +19  +6.6%
      +5.1%     +17 accept_stream                                                                            +17  +5.1%
      +2.7%     +16 publish_new_rpc                                                                          +16  +2.7%
      +1.7%     +16 grpc_server_shutdown_and_notify                                                          +16  +1.7%
      +2.3%     +11 queue_call_request                                                                       +11  +2.3%
      +8.1%     +11 request_matcher_zombify_all_pending_calls((anonymous namespace)::request_matcher*) [     +11  +8.1%
      +3.9%      +8 init_channel_elem                                                                         +8  +3.9%
      +1.4%      +8 grpc_server_start                                                                         +8  +1.4%
  +3.9%    +130 src/core/ext/filters/http/message_compress/message_compress_filter.cc                   +130  +3.9%
       +95%    +138 init_call_elem                                                                          +138   +95%
  +0.8%    +128 src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc                          +128  +0.8%
      +3.2%     +33 grpc_core::(anonymous namespace)::GrpcLbFactory::CreateLoadBalancingPolicy(grpc_core     +33  +3.2%
      +2.0%     +32 grpc_core::(anonymous namespace)::GrpcLb::StartBalancerCallLocked                        +32  +2.0%
      +0.8%     +16 grpc_core::(anonymous namespace)::GrpcLb::CreateOrUpdateRoundRobinPolicyLocked() [cl     +16  +0.8%
      +4.3%     +16 grpc_core::(anonymous namespace)::GrpcLb::~GrpcLb                                        +16  +4.3%
      +9.2%     +11 grpc_core::(anonymous namespace)::GrpcLb::BalancerCallState::ScheduleNextClientLoadR     +11  +9.2%
      +6.1%     +11 grpc_core::(anonymous namespace)::GrpcLb::StartPickingLocked                             +11  +6.1%
      +2.6%      +8 grpc_core::(anonymous namespace)::GrpcLb::PickLocked                                      +8  +2.6%
      +1.4%      +8 grpc_core::(anonymous namespace)::GrpcLb::BalancerCallState::SendClientLoadReportLoc      +8  +1.4%
  +0.8%    +128 src/core/ext/filters/client_channel/lb_policy/xds/xds.cc                                +128  +0.8%
      +3.2%     +33 grpc_core::(anonymous namespace)::XdsFactory::CreateLoadBalancingPolicy(grpc_core::L     +33  +3.2%
      +2.0%     +32 grpc_core::(anonymous namespace)::XdsLb::StartBalancerCallLocked                         +32  +2.0%
      +0.9%     +16 grpc_core::(anonymous namespace)::XdsLb::CreateOrUpdateRoundRobinPolicyLocked() [clo     +16  +0.9%
      +4.3%     +16 grpc_core::(anonymous namespace)::XdsLb::~XdsLb                                          +16  +4.3%
      +9.2%     +11 grpc_core::(anonymous namespace)::XdsLb::BalancerCallState::ScheduleNextClientLoadRe     +11  +9.2%
      +6.1%     +11 grpc_core::(anonymous namespace)::XdsLb::StartPickingLocked                              +11  +6.1%
      +2.6%      +8 grpc_core::(anonymous namespace)::XdsLb::PickLocked                                       +8  +2.6%
      +1.4%      +8 grpc_core::(anonymous namespace)::XdsLb::BalancerCallState::SendClientLoadReportLock      +8  +1.4%
  +2.8%    +128 src/core/ext/filters/http/server/http_server_filter.cc                                  +128  +2.8%
      [NEW] +2.52Ki hs_filter_incoming_metadata(grpc_call_element*, grpc_metadata_batch*) [clone .isra.6 +2.52Ki  [NEW]
      +115%    +124 hs_init_call_elem                                                                       +124  +115%
      +4.5%      +4 [Unmapped]                                                                                +4  +4.5%
  +5.2%    +112 src/core/ext/filters/deadline/deadline_filter.cc                                        +112  +5.2%
      [NEW]    +261 start_timer_if_needed(grpc_call_element*, long) [clone .part.3]                         +261  [NEW]
      [NEW]    +146 grpc_deadline_state::grpc_deadline_state                                                +146  [NEW]
      [NEW]     +32 grpc_deadline_state::~grpc_deadline_state                                                +32  [NEW]
       +89%     +24 init_call_elem                                                                           +24   +89%
      +6.5%     +16 server_start_transport_stream_op_batch                                                   +16  +6.5%
      +7.7%      +8 grpc_deadline_state_client_start_transport_stream_op_batch                                +8  +7.7%
      +3.0%      +8 timer_callback                                                                            +8  +3.0%
      +6.7%      +8 send_cancel_op_in_call_combiner                                                           +8  +6.7%
       +80%      +4 destroy_call_elem                                                                         +4   +80%
      +1.3%      +2 [Unmapped]                                                                                +2  +1.3%
      +1.4%      +2 start_timer_after_init                                                                    +2  +1.4%
  +3.5%    +112 src/core/lib/security/context/security_context.cc                                       +112  +3.5%
      [NEW]     +50 grpc_client_security_context::~grpc_client_security_context                              +50  [NEW]
      +450%     +45 grpc_client_security_context_create                                                      +45  +450%
      [NEW]     +42 grpc_server_security_context::~grpc_server_security_context                              +42  [NEW]
      +370%     +37 grpc_server_security_context_create                                                      +37  +370%
       +16%     +27 [Unmapped]                                                                               +27   +16%
  +1.2%     +96 src/core/lib/iomgr/resource_quota.cc                                                     +96  +1.2%
      +9.7%     +48 grpc_resource_user_create                                                                +48  +9.7%
       +11%     +32 grpc_resource_quota_create                                                               +32   +11%
       +35%     +16 grpc_resource_user_slice_allocator_init                                                  +16   +35%
      +7.1%      +8 grpc_resource_user_shutdown                                                               +8  +7.1%
      +2.5%      +8 grpc_resource_quota_resize                                                                +8  +2.5%
  +0.9%     +88 src/core/ext/filters/client_channel/subchannel.cc                                        +88  +0.9%
      +7.7%     +24 grpc_core::ConnectedSubchannel::CreateCall                                               +24  +7.7%
      +0.9%     +16 grpc_subchannel_create                                                                   +16  +0.9%
      +1.0%     +16 on_subchannel_connected                                                                  +16  +1.0%
      +4.1%     +16 maybe_start_connecting_locked                                                            +16  +4.1%
      +8.0%      +8 grpc_subchannel_weak_unref                                                                +8  +8.0%
      +3.7%      +8 grpc_subchannel_call_process_op                                                           +8  +3.7%
  +2.8%     +80 src/core/ext/filters/max_age/max_age_filter.cc                                           +80  +2.8%
      +8.9%     +72 init_channel_elem                                                                        +72  +8.9%
      +5.9%      +8 [Unmapped]                                                                                +8  +5.9%
  +1.3%     +80 src/core/lib/iomgr/udp_server.cc                                                         +80  +1.3%
       +10%     +25 GrpcUdpListener::StartListening                                                          +25   +10%
       +11%     +22 GrpcUdpListener::OnFdAboutToOrphan                                                       +22   +11%
      +7.5%     +16 GrpcUdpListener::OnRead                                                                  +16  +7.5%
      +7.9%     +16 GrpcUdpListener::do_write                                                                +16  +7.9%
      +9.5%     +11 GrpcUdpListener::OrphanFd                                                                +11  +9.5%
      +4.5%      +8 GrpcUdpListener::OnCanWrite                                                               +8  +4.5%

 -------------- SHRINKING                                                                            --------------
 -17.7%     -64 src/core/ext/transport/chttp2/transport/incoming_metadata.cc                             -64 -17.7%
      [DEL]     -35 grpc_chttp2_incoming_metadata_buffer_init                                                -35  [DEL]
     -48.8%     -20 [Unmapped]                                                                               -20 -48.8%
      [DEL]      -9 grpc_chttp2_incoming_metadata_buffer_destroy                                              -9  [DEL]
  -1.4%     -52 src/core/lib/security/transport/secure_endpoint.cc                                       -52  -1.4%
      [DEL]    -256 call_read_cb                                                                            -256  [DEL]
      [DEL]    -221 flush_write_staging_buffer                                                              -221  [DEL]
      [DEL]    -151 destroy                                                                                 -151  [DEL]
     -87.8%     -36 endpoint_destroy                                                                         -36 -87.8%
      -5.2%     -20 grpc_secure_endpoint_create                                                              -20  -5.2%
  -1.0%     -32 src/core/ext/transport/chttp2/transport/frame_data.cc                                    -32  -1.0%
      [DEL]    -191 grpc_chttp2_data_parser_destroy                                                         -191  [DEL]
      [DEL]     -17 grpc_chttp2_data_parser_init                                                             -17  [DEL]
     -44.1%     -15 [Unmapped]                                                                               -15 -44.1%

  +0.6% +8.56Ki TOTAL                                                                                +68.5Ki  +0.6%


****************************************************************

libgrpc++.so

     VM SIZE              FILE SIZE
 ++++++++++++++ GROWIN ++++++++++++++
  [ = ]       0 [None]    +736  +0.0%

  [ = ]       0 TOTAL     +736  +0.0%



@grpc-testing
Copy link
Copy Markdown

[trickle] No significant performance differences

@grpc-testing
Copy link
Copy Markdown

Objective-C binary sizes
*****************STATIC******************
  New size                      Old size
   731,375       Core (>)        727,548

 2,020,616      Total (>)      2,016,505

***************FRAMEWORKS****************
  New size                      Old size
 3,974,206       Core (>)      3,916,346

11,180,945      Total (>)     11,123,084


@grpc-testing
Copy link
Copy Markdown

Corrupt JSON data (indicates timeout or crash): 
    bm_call_create.BM_IsolatedFilter_ClientChannelFilter_NoOp_.counters.new: 10
    bm_call_create.BM_IsolatedFilter_ClientChannelFilter_NoOp_.counters.old: 10


[microbenchmarks] Performance differences noted:
Benchmark                                                                            allocs_per_iteration    cpu_time    real_time
-----------------------------------------------------------------------------------  ----------------------  ----------  -----------
BM_HasClearGrpcStatus<ErrorCancelled>                                                                        +7%         +7%
BM_HpackParserParseHeader<AddIndexedSingleInternedElem, UnrefHeader>                                         -49%        -49%
BM_HpackParserParseHeader<AddIndexedSingleStaticElem, UnrefHeader>                                           -74%        -74%
BM_HpackParserParseHeader<EmptyBatch, UnrefHeader>                                                           -97%        -97%
BM_HpackParserParseHeader<IndexedSingleInternedElem, UnrefHeader>                                            -86%        -86%
BM_HpackParserParseHeader<IndexedSingleStaticElem, UnrefHeader>                                              -95%        -95%
BM_HpackParserParseHeader<KeyIndexedSingleInternedElem, UnrefHeader>                                         -63%        -63%
BM_HpackParserParseHeader<KeyIndexedSingleStaticElem, UnrefHeader>                                           -68%        -67%
BM_HpackParserParseHeader<MoreRepresentativeClientInitialMetadata, OnInitialHeader>                          -16%        -16%
BM_HpackParserParseHeader<MoreRepresentativeClientInitialMetadata, UnrefHeader>                              -34%        -34%
BM_HpackParserParseHeader<NonIndexedBinaryElem<1, false>, UnrefHeader>                                       -56%        -56%
BM_HpackParserParseHeader<NonIndexedBinaryElem<1, true>, UnrefHeader>                                        -66%        -66%
BM_HpackParserParseHeader<NonIndexedBinaryElem<10, false>, UnrefHeader>                                      -49%        -49%
BM_HpackParserParseHeader<NonIndexedBinaryElem<10, true>, UnrefHeader>                                       -64%        -64%
BM_HpackParserParseHeader<NonIndexedBinaryElem<100, true>, UnrefHeader>                                      -54%        -54%
BM_HpackParserParseHeader<NonIndexedBinaryElem<3, false>, UnrefHeader>                                       -54%        -54%
BM_HpackParserParseHeader<NonIndexedBinaryElem<3, true>, UnrefHeader>                                        -68%        -68%
BM_HpackParserParseHeader<NonIndexedBinaryElem<31, false>, UnrefHeader>                                      -32%        -32%
BM_HpackParserParseHeader<NonIndexedBinaryElem<31, true>, UnrefHeader>                                       -53%        -53%
BM_HpackParserParseHeader<NonIndexedElem, UnrefHeader>                                                       -64%        -64%
BM_HpackParserParseHeader<RepresentativeClientInitialMetadata, OnInitialHeader>                              -40%        -40%
BM_HpackParserParseHeader<RepresentativeClientInitialMetadata, UnrefHeader>                                  -59%        -59%
BM_HpackParserParseHeader<RepresentativeServerInitialMetadata, OnInitialHeader>                              -71%        -71%
BM_HpackParserParseHeader<RepresentativeServerInitialMetadata, UnrefHeader>                                  -83%        -83%
BM_HpackParserParseHeader<RepresentativeServerTrailingMetadata, UnrefHeader>                                 -86%        -86%
BM_HpackParserParseHeader<SameDeadline, OnHeaderTimeout>                                                     -63%        -63%
BM_IsolatedFilter<HttpClientFilter, NoOp>                                                                    +20%        +20%
BM_LameChannelCallCreateCore                                                         -6%
BM_LameChannelCallCreateCoreSeparateBatch                                            -5%
BM_LameChannelCallCreateCpp                                                          -5%
BM_MetadataRefUnrefStatic                                                                                    +12%        +12%

@grpc-testing
Copy link
Copy Markdown

****************************************************************

libgrpc.so

     VM SIZE                                                                                            FILE SIZE
 ++++++++++++++ GROWING                                                                              ++++++++++++++
  +0.2% +1.46Ki [None]                                                                               +61.4Ki  +0.6%
      +0.2% +1.40Ki [Unmapped]                                                                           +61.4Ki  +0.6%
      [NEW]     +80 (anonymous namespace)::inproc_vtable                                                     +80  [NEW]
      +5.3%     +56 [None]                                                                                     0  [ = ]
      [NEW]     +32 (anonymous namespace)::g_empty_slice                                                       0  [ = ]
      [NEW]     +32 (anonymous namespace)::g_fake_auth_key                                                     0  [ = ]
      [NEW]     +32 (anonymous namespace)::g_fake_path_key                                                     0  [ = ]
      [NEW]     +32 (anonymous namespace)::g_fake_auth_value                                                   0  [ = ]
      [NEW]     +32 (anonymous namespace)::g_fake_path_value                                                   0  [ = ]
      [NEW]     +32 add_retriable_send_initial_metadata_op((anonymous namespace)::call_data*, (anonymous     +32  [NEW]
      [NEW]      +4 (anonymous namespace)::g_init_strategy                                                     0  [ = ]
      [NEW]      +4 (anonymous namespace)::g_init_strategy_once                                                0  [ = ]
  +4.8% +1.56Ki src/core/ext/transport/chttp2/transport/chttp2_transport.cc                          +1.56Ki  +4.8%
      [NEW] +4.00Ki grpc_chttp2_transport::grpc_chttp2_transport                                         +4.00Ki  [NEW]
      [NEW] +1.10Ki grpc_chttp2_stream::grpc_chttp2_stream                                               +1.10Ki  [NEW]
      [NEW] +1.06Ki grpc_chttp2_stream::~grpc_chttp2_stream                                              +1.06Ki  [NEW]
      [NEW]    +735 grpc_chttp2_transport::~grpc_chttp2_transport                                           +735  [NEW]
      [NEW]    +359 try_http_parsing(grpc_chttp2_transport*) [clone .isra.6]                                +359  [NEW]
      [NEW]    +281 removal_error(grpc_error*, grpc_chttp2_stream*, char const*) [clone .isra.7]            +281  [NEW]
      [NEW]     +46 post_destructive_reclaimer(grpc_chttp2_transport*) [clone .part.31]                      +46  [NEW]
      [NEW]     +43 post_benign_reclaimer(grpc_chttp2_transport*) [clone .part.32]                           +43  [NEW]
      +3.7%     +16 write_action_end_locked                                                                  +16  +3.7%
      +0.5%     +16 perform_stream_op_locked                                                                 +16  +0.5%
      +3.2%     +16 write_action_begin_locked                                                                +16  +3.2%
      +2.9%     +16 init_keepalive_ping_locked                                                               +16  +2.9%
      +7.5%     +11 grpc_chttp2_initiate_write                                                               +11  +7.5%
       +16%     +11 write_action                                                                             +11   +16%
      +7.6%     +11 perform_transport_op                                                                     +11  +7.6%
       +20%     +11 grpc_core::Chttp2IncomingByteStream::Orphan                                              +11   +20%
      +1.3%      +9 [Unmapped]                                                                                +9  +1.3%
      +7.9%      +8 [Other]                                                                                   +8  +7.9%
      +6.7%      +8 destroy_stream                                                                            +8  +6.7%
      +9.4%      +8 destroy_transport                                                                         +8  +9.4%
      +2.4%      +8 perform_stream_op                                                                         +8  +2.4%
  +2.6%    +992 src/core/ext/filters/client_channel/client_channel.cc                                   +992  +2.6%
      [NEW] +2.12Ki run_closures_for_completed_call                                                      +2.12Ki  [NEW]
      [NEW] +1.45Ki maybe_retry                                                                          +1.45Ki  [NEW]
      [NEW]    +397 add_closure_for_subchannel_batch(grpc_call_element*, grpc_transport_stream_op_batch*    +397  [NEW]
      [NEW]    +352 add_retriable_send_initial_metadata_op                                                  +352  [NEW]
       +37%    +320 pick_done                                                                               +320   +37%
      +107%    +287 cc_init_call_elem                                                                       +287  +107%
      [NEW]    +256 retry_commit                                                                            +256  [NEW]
      [NEW]    +250 maybe_clear_pending_batch(grpc_call_element*, (anonymous namespace)::pending_batch*)    +250  [NEW]
      [NEW]    +192 add_retriable_send_message_op(grpc_call_element*, (anonymous namespace)::subchannel_    +192  [NEW]
      [NEW]    +189 batch_data_unref                                                                        +189  [NEW]
      +2.6%    +134 [Other]                                                                                 +134  +2.6%
      [NEW]    +110 free_cached_send_message                                                                +110  [NEW]
      [NEW]     +67 free_cached_send_initial_metadata                                                        +67  [NEW]
      [NEW]     +67 free_cached_send_trailing_metadata                                                       +67  [NEW]
      +1.3%     +64 on_resolver_result_changed_locked                                                        +64  +1.3%
      +1.3%     +48 start_retriable_subchannel_batches                                                       +48  +1.3%
      +2.4%     +32 cc_init_channel_elem                                                                     +32  +2.4%
      +6.1%     +32 cc_destroy_channel_elem                                                                  +32  +6.1%
      +2.0%     +32 start_transport_op_locked                                                                +32  +2.0%
       +15%     +25 batch_data_create                                                                        +25   +15%
       +13%     +21 grpc_client_channel_watch_connectivity_state                                             +21   +13%
  +5.8%    +928 src/core/lib/surface/call.cc                                                            +928  +5.8%
       +38%    +736 grpc_call_create                                                                        +736   +38%
      [NEW]    +476 set_encodings_accepted_by_peer(grpc_call*, grpc_mdelem, unsigned int*, bool) [clone     +476  [NEW]
      [NEW]    +259 publish_app_metadata(grpc_call*, grpc_metadata_batch*, int) [clone .isra.3]             +259  [NEW]
      +4.2%    +144 call_start_batch                                                                        +144  +4.2%
      [NEW]     +47 get_md_elem(grpc_metadata*, grpc_metadata*, int, int) [clone .part.2]                    +47  [NEW]
      +9.1%     +16 grpc_call_set_completion_queue                                                           +16  +9.1%
       +23%     +16 release_call                                                                             +16   +23%
      +7.2%     +16 cancel_with_error                                                                        +16  +7.2%
      +3.3%     +16 receiving_stream_ready                                                                   +16  +3.3%
      +1.0%     +16 receiving_initial_metadata_ready                                                         +16  +1.0%
      +2.3%      +8 destroy_call                                                                              +8  +2.3%
  +0.7%    +895 [Other]                                                                                 +895  +0.7%
  +4.4%    +656 src/core/ext/transport/inproc/inproc_transport.cc                                       +656  +4.4%
      [NEW] +3.53Ki (anonymous namespace)::op_state_machine                                              +3.53Ki  [NEW]
      [NEW] +2.53Ki (anonymous namespace)::perform_stream_op                                             +2.53Ki  [NEW]
      [NEW] +1.72Ki (anonymous namespace)::fail_helper_locked                                            +1.72Ki  [NEW]
      [NEW] +1.28Ki (anonymous namespace)::init_stream                                                   +1.28Ki  [NEW]
      [NEW]    +854 (anonymous namespace)::cancel_stream_locked                                             +854  [NEW]
      [NEW]    +604 (anonymous namespace)::message_transfer_locked                                          +604  [NEW]
      [NEW]    +471 (anonymous namespace)::destroy_transport                                                +471  [NEW]
      [NEW]    +437 (anonymous namespace)::destroy_stream                                                   +437  [NEW]
      [NEW]    +329 (anonymous namespace)::close_transport_locked                                           +329  [NEW]
      [NEW]    +321 (anonymous namespace)::fill_in_metadata((anonymous namespace)::inproc_stream*, grpc_    +321  [NEW]
      [NEW]    +257 (anonymous namespace)::close_stream_locked((anonymous namespace)::inproc_stream*) [c    +257  [NEW]
      [NEW]    +257 (anonymous namespace)::perform_transport_op                                             +257  [NEW]
      [NEW]    +242 (anonymous namespace)::complete_if_batch_end_locked                                     +242  [NEW]
      [NEW]    +219 (anonymous namespace)::log_metadata                                                     +219  [NEW]
      [NEW]    +123 (anonymous namespace)::close_other_side_locked((anonymous namespace)::inproc_stream*    +123  [NEW]
      [NEW]     +96 (anonymous namespace)::maybe_schedule_op_closure_locked((anonymous namespace)::inpro     +96  [NEW]
      +8.3%     +55 grpc_inproc_channel_create                                                               +55  +8.3%
      [NEW]      +3 (anonymous namespace)::get_endpoint                                                       +3  [NEW]
      [NEW]      +2 [Other]                                                                                   +2  [NEW]
      [NEW]      +2 (anonymous namespace)::do_nothing                                                         +2  [NEW]
      [NEW]      +2 (anonymous namespace)::set_pollset                                                        +2  [NEW]
  +5.8%    +448 src/core/ext/filters/client_channel/health/health_check_client.cc                       +448  +5.8%
      +129%    +325 grpc_core::HealthCheckClient::CallState::CallState                                      +325  +129%
      +3.1%     +48 grpc_core::HealthCheckClient::CallState::StartCall                                       +48  +3.1%
       +11%     +24 [Unmapped]                                                                               +24   +11%
       +12%     +16 grpc_core::HealthCheckClient::CallState::RecvMessageReady                                +16   +12%
      +1.3%     +16 grpc_core::HealthCheckClient::CallState::DoneReadingRecvMessage                          +16  +1.3%
      +2.9%     +11 grpc_core::HealthCheckClient::HealthCheckClient                                          +11  +2.9%
       +13%      +8 grpc_core::HealthCheckClient::CallState::StartBatch                                       +8   +13%
      +7.4%      +8 grpc_core::HealthCheckClient::CallState::StartCancel                                      +8  +7.4%
      +7.0%      +8 grpc_core::HealthCheckClient::CallState::Cancel                                           +8  +7.0%
   +99%    +280 src/core/lib/gpr/arena.cc                                                               +280   +99%
      [NEW]    +150 set_strategy_from_env                                                                   +150  [NEW]
      [NEW]    +108 gpr_arena_alloc_maybe_init                                                              +108  [NEW]
      [NEW]     +19 gpr_arena_init                                                                           +19  [NEW]
       +45%      +9 [Unmapped]                                                                                +9   +45%
      +6.8%      +5 gpr_arena_create                                                                          +5  +6.8%
  +4.0%    +208 src/core/ext/filters/http/client/http_client_filter.cc                                  +208  +4.0%
      +156%    +212 init_call_elem                                                                          +212  +156%
  +5.2%    +168 src/core/lib/security/transport/client_auth_filter.cc                                   +168  +5.2%
       +98%    +132 init_call_elem                                                                          +132   +98%
      +4.0%     +24 auth_start_transport_stream_op_batch                                                     +24  +4.0%
      +2.0%     +16 on_host_checked                                                                          +16  +2.0%
  +1.0%    +160 src/core/lib/surface/server.cc                                                          +160  +1.0%
      +9.6%     +32 [Unmapped]                                                                               +32  +9.6%
       +11%     +22 init_call_elem                                                                           +22   +11%
      +6.6%     +19 finish_start_new_rpc                                                                     +19  +6.6%
      +5.1%     +17 accept_stream                                                                            +17  +5.1%
      +2.7%     +16 publish_new_rpc                                                                          +16  +2.7%
      +1.7%     +16 grpc_server_shutdown_and_notify                                                          +16  +1.7%
      +2.3%     +11 queue_call_request                                                                       +11  +2.3%
      +8.1%     +11 request_matcher_zombify_all_pending_calls((anonymous namespace)::request_matcher*) [     +11  +8.1%
      +3.9%      +8 init_channel_elem                                                                         +8  +3.9%
      +1.4%      +8 grpc_server_start                                                                         +8  +1.4%
  +3.9%    +130 src/core/ext/filters/http/message_compress/message_compress_filter.cc                   +130  +3.9%
       +95%    +138 init_call_elem                                                                          +138   +95%
  +0.8%    +128 src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc                          +128  +0.8%
      +3.2%     +33 grpc_core::(anonymous namespace)::GrpcLbFactory::CreateLoadBalancingPolicy(grpc_core     +33  +3.2%
      +2.0%     +32 grpc_core::(anonymous namespace)::GrpcLb::StartBalancerCallLocked                        +32  +2.0%
      +0.8%     +16 grpc_core::(anonymous namespace)::GrpcLb::CreateOrUpdateRoundRobinPolicyLocked() [cl     +16  +0.8%
      +4.3%     +16 grpc_core::(anonymous namespace)::GrpcLb::~GrpcLb                                        +16  +4.3%
      +9.2%     +11 grpc_core::(anonymous namespace)::GrpcLb::BalancerCallState::ScheduleNextClientLoadR     +11  +9.2%
      +6.1%     +11 grpc_core::(anonymous namespace)::GrpcLb::StartPickingLocked                             +11  +6.1%
      +2.6%      +8 grpc_core::(anonymous namespace)::GrpcLb::PickLocked                                      +8  +2.6%
      +1.4%      +8 grpc_core::(anonymous namespace)::GrpcLb::BalancerCallState::SendClientLoadReportLoc      +8  +1.4%
  +0.8%    +128 src/core/ext/filters/client_channel/lb_policy/xds/xds.cc                                +128  +0.8%
      +3.2%     +33 grpc_core::(anonymous namespace)::XdsFactory::CreateLoadBalancingPolicy(grpc_core::L     +33  +3.2%
      +2.0%     +32 grpc_core::(anonymous namespace)::XdsLb::StartBalancerCallLocked                         +32  +2.0%
      +0.9%     +16 grpc_core::(anonymous namespace)::XdsLb::CreateOrUpdateRoundRobinPolicyLocked() [clo     +16  +0.9%
      +4.3%     +16 grpc_core::(anonymous namespace)::XdsLb::~XdsLb                                          +16  +4.3%
      +9.2%     +11 grpc_core::(anonymous namespace)::XdsLb::BalancerCallState::ScheduleNextClientLoadRe     +11  +9.2%
      +6.1%     +11 grpc_core::(anonymous namespace)::XdsLb::StartPickingLocked                              +11  +6.1%
      +2.6%      +8 grpc_core::(anonymous namespace)::XdsLb::PickLocked                                       +8  +2.6%
      +1.4%      +8 grpc_core::(anonymous namespace)::XdsLb::BalancerCallState::SendClientLoadReportLock      +8  +1.4%
  +2.8%    +128 src/core/ext/filters/http/server/http_server_filter.cc                                  +128  +2.8%
      [NEW] +2.52Ki hs_filter_incoming_metadata(grpc_call_element*, grpc_metadata_batch*) [clone .isra.6 +2.52Ki  [NEW]
      +115%    +124 hs_init_call_elem                                                                       +124  +115%
      +4.5%      +4 [Unmapped]                                                                                +4  +4.5%
  +5.2%    +112 src/core/ext/filters/deadline/deadline_filter.cc                                        +112  +5.2%
      [NEW]    +261 start_timer_if_needed(grpc_call_element*, long) [clone .part.3]                         +261  [NEW]
      [NEW]    +146 grpc_deadline_state::grpc_deadline_state                                                +146  [NEW]
      [NEW]     +32 grpc_deadline_state::~grpc_deadline_state                                                +32  [NEW]
       +89%     +24 init_call_elem                                                                           +24   +89%
      +6.5%     +16 server_start_transport_stream_op_batch                                                   +16  +6.5%
      +7.7%      +8 grpc_deadline_state_client_start_transport_stream_op_batch                                +8  +7.7%
      +3.0%      +8 timer_callback                                                                            +8  +3.0%
      +6.7%      +8 send_cancel_op_in_call_combiner                                                           +8  +6.7%
       +80%      +4 destroy_call_elem                                                                         +4   +80%
      +1.3%      +2 [Unmapped]                                                                                +2  +1.3%
      +1.4%      +2 start_timer_after_init                                                                    +2  +1.4%
  +3.5%    +112 src/core/lib/security/context/security_context.cc                                       +112  +3.5%
      [NEW]     +50 grpc_client_security_context::~grpc_client_security_context                              +50  [NEW]
      +450%     +45 grpc_client_security_context_create                                                      +45  +450%
      [NEW]     +42 grpc_server_security_context::~grpc_server_security_context                              +42  [NEW]
      +370%     +37 grpc_server_security_context_create                                                      +37  +370%
       +16%     +27 [Unmapped]                                                                               +27   +16%
  +1.2%     +96 src/core/lib/iomgr/resource_quota.cc                                                     +96  +1.2%
      +9.7%     +48 grpc_resource_user_create                                                                +48  +9.7%
       +11%     +32 grpc_resource_quota_create                                                               +32   +11%
       +35%     +16 grpc_resource_user_slice_allocator_init                                                  +16   +35%
      +7.1%      +8 grpc_resource_user_shutdown                                                               +8  +7.1%
      +2.5%      +8 grpc_resource_quota_resize                                                                +8  +2.5%
  +0.9%     +88 src/core/ext/filters/client_channel/subchannel.cc                                        +88  +0.9%
      +7.7%     +24 grpc_core::ConnectedSubchannel::CreateCall                                               +24  +7.7%
      +0.9%     +16 grpc_subchannel_create                                                                   +16  +0.9%
      +1.0%     +16 on_subchannel_connected                                                                  +16  +1.0%
      +4.1%     +16 maybe_start_connecting_locked                                                            +16  +4.1%
      +8.0%      +8 grpc_subchannel_weak_unref                                                                +8  +8.0%
      +3.7%      +8 grpc_subchannel_call_process_op                                                           +8  +3.7%
  +2.8%     +80 src/core/ext/filters/max_age/max_age_filter.cc                                           +80  +2.8%
      +8.9%     +72 init_channel_elem                                                                        +72  +8.9%
      +5.9%      +8 [Unmapped]                                                                                +8  +5.9%
  +1.3%     +80 src/core/lib/iomgr/udp_server.cc                                                         +80  +1.3%
       +10%     +25 GrpcUdpListener::StartListening                                                          +25   +10%
       +11%     +22 GrpcUdpListener::OnFdAboutToOrphan                                                       +22   +11%
      +7.5%     +16 GrpcUdpListener::OnRead                                                                  +16  +7.5%
      +7.9%     +16 GrpcUdpListener::do_write                                                                +16  +7.9%
      +9.5%     +11 GrpcUdpListener::OrphanFd                                                                +11  +9.5%
      +4.5%      +8 GrpcUdpListener::OnCanWrite                                                               +8  +4.5%

 -------------- SHRINKING                                                                            --------------
 -17.7%     -64 src/core/ext/transport/chttp2/transport/incoming_metadata.cc                             -64 -17.7%
      [DEL]     -35 grpc_chttp2_incoming_metadata_buffer_init                                                -35  [DEL]
     -48.8%     -20 [Unmapped]                                                                               -20 -48.8%
      [DEL]      -9 grpc_chttp2_incoming_metadata_buffer_destroy                                              -9  [DEL]
  -1.4%     -52 src/core/lib/security/transport/secure_endpoint.cc                                       -52  -1.4%
      [DEL]    -256 call_read_cb                                                                            -256  [DEL]
      [DEL]    -221 flush_write_staging_buffer                                                              -221  [DEL]
      [DEL]    -151 destroy                                                                                 -151  [DEL]
     -87.8%     -36 endpoint_destroy                                                                         -36 -87.8%
      -5.2%     -20 grpc_secure_endpoint_create                                                              -20  -5.2%
  -1.0%     -32 src/core/ext/transport/chttp2/transport/frame_data.cc                                    -32  -1.0%
      [DEL]    -191 grpc_chttp2_data_parser_destroy                                                         -191  [DEL]
      [DEL]     -17 grpc_chttp2_data_parser_init                                                             -17  [DEL]
     -44.1%     -15 [Unmapped]                                                                               -15 -44.1%

  +0.6% +8.56Ki TOTAL                                                                                +68.5Ki  +0.6%


****************************************************************

libgrpc++.so

     VM SIZE              FILE SIZE
 ++++++++++++++ GROWIN ++++++++++++++
  [ = ]       0 [None]    +736  +0.0%

  [ = ]       0 TOTAL     +736  +0.0%



@grpc-testing
Copy link
Copy Markdown

[trickle] No significant performance differences

@grpc-testing
Copy link
Copy Markdown

Objective-C binary sizes
*****************STATIC******************
  New size                      Old size
   731,375       Core (>)        727,548

 2,020,616      Total (>)      2,016,505

***************FRAMEWORKS****************
  New size                      Old size
 3,974,206       Core (>)      3,916,346

11,180,942      Total (>)     11,123,082


@grpc-testing
Copy link
Copy Markdown

Corrupt JSON data (indicates timeout or crash): 
    bm_call_create.BM_IsolatedFilter_ClientChannelFilter_NoOp_.counters.new: 10
    bm_call_create.BM_IsolatedFilter_ClientChannelFilter_NoOp_.counters.old: 10


[microbenchmarks] Performance differences noted:
Benchmark                                                                        allocs_per_iteration    cpu_time    real_time
-------------------------------------------------------------------------------  ----------------------  ----------  -----------
BM_HpackParserParseHeader<AddIndexedSingleInternedElem, UnrefHeader>                                     -35%        -35%
BM_HpackParserParseHeader<AddIndexedSingleStaticElem, UnrefHeader>                                       -42%        -42%
BM_HpackParserParseHeader<EmptyBatch, UnrefHeader>                                                       -92%        -92%
BM_HpackParserParseHeader<IndexedSingleInternedElem, UnrefHeader>                                        -57%        -57%
BM_HpackParserParseHeader<IndexedSingleStaticElem, UnrefHeader>                                          -85%        -85%
BM_HpackParserParseHeader<KeyIndexedSingleInternedElem, UnrefHeader>                                     -57%        -57%
BM_HpackParserParseHeader<KeyIndexedSingleStaticElem, UnrefHeader>                                       -38%        -38%
BM_HpackParserParseHeader<MoreRepresentativeClientInitialMetadata, UnrefHeader>                          -19%        -19%
BM_HpackParserParseHeader<NonIndexedBinaryElem<1, false>, UnrefHeader>                                   -40%        -40%
BM_HpackParserParseHeader<NonIndexedBinaryElem<1, true>, UnrefHeader>                                    -39%        -39%
BM_HpackParserParseHeader<NonIndexedBinaryElem<10, false>, UnrefHeader>                                  -38%        -38%
BM_HpackParserParseHeader<NonIndexedBinaryElem<10, true>, UnrefHeader>                                   -18%        -18%
BM_HpackParserParseHeader<NonIndexedBinaryElem<100, true>, UnrefHeader>                                  -43%        -43%
BM_HpackParserParseHeader<NonIndexedBinaryElem<3, false>, UnrefHeader>                                   -39%        -39%
BM_HpackParserParseHeader<NonIndexedBinaryElem<3, true>, UnrefHeader>                                    -55%        -55%
BM_HpackParserParseHeader<NonIndexedBinaryElem<31, false>, UnrefHeader>                                  -15%        -15%
BM_HpackParserParseHeader<NonIndexedBinaryElem<31, true>, UnrefHeader>                                   -52%        -52%
BM_HpackParserParseHeader<NonIndexedElem, UnrefHeader>                                                   -38%        -38%
BM_HpackParserParseHeader<RepresentativeClientInitialMetadata, OnInitialHeader>                          -28%        -28%
BM_HpackParserParseHeader<RepresentativeClientInitialMetadata, UnrefHeader>                              -44%        -44%
BM_HpackParserParseHeader<RepresentativeServerInitialMetadata, OnInitialHeader>                          -26%        -26%
BM_HpackParserParseHeader<RepresentativeServerInitialMetadata, UnrefHeader>                              -75%        -75%
BM_HpackParserParseHeader<RepresentativeServerTrailingMetadata, UnrefHeader>                             -66%        -66%
BM_HpackParserParseHeader<SameDeadline, OnHeaderTimeout>                                                 -57%        -57%
BM_IsolatedFilter<HttpClientFilter, NoOp>                                                                +4%         +4%
BM_IsolatedFilter<HttpServerFilter, NoOp>                                                                +4%         +4%
BM_LameChannelCallCreateCore                                                     -6%
BM_LameChannelCallCreateCoreSeparateBatch                                        -5%
BM_LameChannelCallCreateCpp                                                      -5%

Callers are updated to properly initialize the memory.

This behavior can be overridden using GRPC_ARENA_INIT_STRATEGY
environment variable.
@grpc-testing
Copy link
Copy Markdown

****************************************************************

libgrpc.so

     VM SIZE                                                                                            FILE SIZE
 ++++++++++++++ GROWING                                                                              ++++++++++++++
  +0.2% +1.46Ki [None]                                                                               +61.4Ki  +0.6%
      +0.2% +1.40Ki [Unmapped]                                                                           +61.4Ki  +0.6%
      [NEW]     +80 (anonymous namespace)::inproc_vtable                                                     +80  [NEW]
      +5.3%     +56 [None]                                                                                     0  [ = ]
      [NEW]     +32 (anonymous namespace)::g_empty_slice                                                       0  [ = ]
      [NEW]     +32 (anonymous namespace)::g_fake_auth_key                                                     0  [ = ]
      [NEW]     +32 (anonymous namespace)::g_fake_path_key                                                     0  [ = ]
      [NEW]     +32 (anonymous namespace)::g_fake_auth_value                                                   0  [ = ]
      [NEW]     +32 (anonymous namespace)::g_fake_path_value                                                   0  [ = ]
      [NEW]     +32 add_retriable_send_initial_metadata_op((anonymous namespace)::call_data*, (anonymous     +32  [NEW]
      [NEW]      +4 (anonymous namespace)::g_init_strategy                                                     0  [ = ]
      [NEW]      +4 (anonymous namespace)::g_init_strategy_once                                                0  [ = ]
  +4.8% +1.56Ki src/core/ext/transport/chttp2/transport/chttp2_transport.cc                          +1.56Ki  +4.8%
      [NEW] +4.00Ki grpc_chttp2_transport::grpc_chttp2_transport                                         +4.00Ki  [NEW]
      [NEW] +1.10Ki grpc_chttp2_stream::grpc_chttp2_stream                                               +1.10Ki  [NEW]
      [NEW] +1.06Ki grpc_chttp2_stream::~grpc_chttp2_stream                                              +1.06Ki  [NEW]
      [NEW]    +735 grpc_chttp2_transport::~grpc_chttp2_transport                                           +735  [NEW]
      [NEW]    +359 try_http_parsing(grpc_chttp2_transport*) [clone .isra.6]                                +359  [NEW]
      [NEW]    +281 removal_error(grpc_error*, grpc_chttp2_stream*, char const*) [clone .isra.7]            +281  [NEW]
      [NEW]     +46 post_destructive_reclaimer(grpc_chttp2_transport*) [clone .part.31]                      +46  [NEW]
      [NEW]     +43 post_benign_reclaimer(grpc_chttp2_transport*) [clone .part.32]                           +43  [NEW]
      +3.7%     +16 write_action_end_locked                                                                  +16  +3.7%
      +0.5%     +16 perform_stream_op_locked                                                                 +16  +0.5%
      +3.2%     +16 write_action_begin_locked                                                                +16  +3.2%
      +2.9%     +16 init_keepalive_ping_locked                                                               +16  +2.9%
      +7.5%     +11 grpc_chttp2_initiate_write                                                               +11  +7.5%
       +16%     +11 write_action                                                                             +11   +16%
      +7.6%     +11 perform_transport_op                                                                     +11  +7.6%
       +20%     +11 grpc_core::Chttp2IncomingByteStream::Orphan                                              +11   +20%
      +1.3%      +9 [Unmapped]                                                                                +9  +1.3%
      +7.9%      +8 [Other]                                                                                   +8  +7.9%
      +6.7%      +8 destroy_stream                                                                            +8  +6.7%
      +9.4%      +8 destroy_transport                                                                         +8  +9.4%
      +2.4%      +8 perform_stream_op                                                                         +8  +2.4%
  +2.6%    +992 src/core/ext/filters/client_channel/client_channel.cc                                   +992  +2.6%
      [NEW] +2.12Ki run_closures_for_completed_call                                                      +2.12Ki  [NEW]
      [NEW] +1.45Ki maybe_retry                                                                          +1.45Ki  [NEW]
      [NEW]    +397 add_closure_for_subchannel_batch(grpc_call_element*, grpc_transport_stream_op_batch*    +397  [NEW]
      [NEW]    +352 add_retriable_send_initial_metadata_op                                                  +352  [NEW]
       +37%    +320 pick_done                                                                               +320   +37%
      +107%    +287 cc_init_call_elem                                                                       +287  +107%
      [NEW]    +256 retry_commit                                                                            +256  [NEW]
      [NEW]    +250 maybe_clear_pending_batch(grpc_call_element*, (anonymous namespace)::pending_batch*)    +250  [NEW]
      [NEW]    +192 add_retriable_send_message_op(grpc_call_element*, (anonymous namespace)::subchannel_    +192  [NEW]
      [NEW]    +189 batch_data_unref                                                                        +189  [NEW]
      +2.6%    +134 [Other]                                                                                 +134  +2.6%
      [NEW]    +110 free_cached_send_message                                                                +110  [NEW]
      [NEW]     +67 free_cached_send_initial_metadata                                                        +67  [NEW]
      [NEW]     +67 free_cached_send_trailing_metadata                                                       +67  [NEW]
      +1.3%     +64 on_resolver_result_changed_locked                                                        +64  +1.3%
      +1.3%     +48 start_retriable_subchannel_batches                                                       +48  +1.3%
      +2.4%     +32 cc_init_channel_elem                                                                     +32  +2.4%
      +6.1%     +32 cc_destroy_channel_elem                                                                  +32  +6.1%
      +2.0%     +32 start_transport_op_locked                                                                +32  +2.0%
       +15%     +25 batch_data_create                                                                        +25   +15%
       +13%     +21 grpc_client_channel_watch_connectivity_state                                             +21   +13%
  +5.8%    +928 src/core/lib/surface/call.cc                                                            +928  +5.8%
       +38%    +736 grpc_call_create                                                                        +736   +38%
      [NEW]    +476 set_encodings_accepted_by_peer(grpc_call*, grpc_mdelem, unsigned int*, bool) [clone     +476  [NEW]
      [NEW]    +259 publish_app_metadata(grpc_call*, grpc_metadata_batch*, int) [clone .isra.3]             +259  [NEW]
      +4.2%    +144 call_start_batch                                                                        +144  +4.2%
      [NEW]     +47 get_md_elem(grpc_metadata*, grpc_metadata*, int, int) [clone .part.2]                    +47  [NEW]
      +9.1%     +16 grpc_call_set_completion_queue                                                           +16  +9.1%
       +23%     +16 release_call                                                                             +16   +23%
      +7.2%     +16 cancel_with_error                                                                        +16  +7.2%
      +3.3%     +16 receiving_stream_ready                                                                   +16  +3.3%
      +1.0%     +16 receiving_initial_metadata_ready                                                         +16  +1.0%
      +2.3%      +8 destroy_call                                                                              +8  +2.3%
  +0.7%    +895 [Other]                                                                                 +895  +0.7%
  +4.4%    +656 src/core/ext/transport/inproc/inproc_transport.cc                                       +656  +4.4%
      [NEW] +3.53Ki (anonymous namespace)::op_state_machine                                              +3.53Ki  [NEW]
      [NEW] +2.53Ki (anonymous namespace)::perform_stream_op                                             +2.53Ki  [NEW]
      [NEW] +1.72Ki (anonymous namespace)::fail_helper_locked                                            +1.72Ki  [NEW]
      [NEW] +1.28Ki (anonymous namespace)::init_stream                                                   +1.28Ki  [NEW]
      [NEW]    +854 (anonymous namespace)::cancel_stream_locked                                             +854  [NEW]
      [NEW]    +604 (anonymous namespace)::message_transfer_locked                                          +604  [NEW]
      [NEW]    +471 (anonymous namespace)::destroy_transport                                                +471  [NEW]
      [NEW]    +437 (anonymous namespace)::destroy_stream                                                   +437  [NEW]
      [NEW]    +329 (anonymous namespace)::close_transport_locked                                           +329  [NEW]
      [NEW]    +321 (anonymous namespace)::fill_in_metadata((anonymous namespace)::inproc_stream*, grpc_    +321  [NEW]
      [NEW]    +257 (anonymous namespace)::close_stream_locked((anonymous namespace)::inproc_stream*) [c    +257  [NEW]
      [NEW]    +257 (anonymous namespace)::perform_transport_op                                             +257  [NEW]
      [NEW]    +242 (anonymous namespace)::complete_if_batch_end_locked                                     +242  [NEW]
      [NEW]    +219 (anonymous namespace)::log_metadata                                                     +219  [NEW]
      [NEW]    +123 (anonymous namespace)::close_other_side_locked((anonymous namespace)::inproc_stream*    +123  [NEW]
      [NEW]     +96 (anonymous namespace)::maybe_schedule_op_closure_locked((anonymous namespace)::inpro     +96  [NEW]
      +8.3%     +55 grpc_inproc_channel_create                                                               +55  +8.3%
      [NEW]      +3 (anonymous namespace)::get_endpoint                                                       +3  [NEW]
      [NEW]      +2 [Other]                                                                                   +2  [NEW]
      [NEW]      +2 (anonymous namespace)::do_nothing                                                         +2  [NEW]
      [NEW]      +2 (anonymous namespace)::set_pollset                                                        +2  [NEW]
  +5.8%    +448 src/core/ext/filters/client_channel/health/health_check_client.cc                       +448  +5.8%
      +129%    +325 grpc_core::HealthCheckClient::CallState::CallState                                      +325  +129%
      +3.1%     +48 grpc_core::HealthCheckClient::CallState::StartCall                                       +48  +3.1%
       +11%     +24 [Unmapped]                                                                               +24   +11%
       +12%     +16 grpc_core::HealthCheckClient::CallState::RecvMessageReady                                +16   +12%
      +1.3%     +16 grpc_core::HealthCheckClient::CallState::DoneReadingRecvMessage                          +16  +1.3%
      +2.9%     +11 grpc_core::HealthCheckClient::HealthCheckClient                                          +11  +2.9%
       +13%      +8 grpc_core::HealthCheckClient::CallState::StartBatch                                       +8   +13%
      +7.4%      +8 grpc_core::HealthCheckClient::CallState::StartCancel                                      +8  +7.4%
      +7.0%      +8 grpc_core::HealthCheckClient::CallState::Cancel                                           +8  +7.0%
   +99%    +280 src/core/lib/gpr/arena.cc                                                               +280   +99%
      [NEW]    +150 set_strategy_from_env                                                                   +150  [NEW]
      [NEW]    +108 gpr_arena_alloc_maybe_init                                                              +108  [NEW]
      [NEW]     +19 gpr_arena_init                                                                           +19  [NEW]
       +45%      +9 [Unmapped]                                                                                +9   +45%
      +6.8%      +5 gpr_arena_create                                                                          +5  +6.8%
  +4.0%    +208 src/core/ext/filters/http/client/http_client_filter.cc                                  +208  +4.0%
      +156%    +212 init_call_elem                                                                          +212  +156%
  +5.2%    +168 src/core/lib/security/transport/client_auth_filter.cc                                   +168  +5.2%
       +98%    +132 init_call_elem                                                                          +132   +98%
      +4.0%     +24 auth_start_transport_stream_op_batch                                                     +24  +4.0%
      +2.0%     +16 on_host_checked                                                                          +16  +2.0%
  +1.0%    +160 src/core/lib/surface/server.cc                                                          +160  +1.0%
      +9.6%     +32 [Unmapped]                                                                               +32  +9.6%
       +11%     +22 init_call_elem                                                                           +22   +11%
      +6.6%     +19 finish_start_new_rpc                                                                     +19  +6.6%
      +5.1%     +17 accept_stream                                                                            +17  +5.1%
      +2.7%     +16 publish_new_rpc                                                                          +16  +2.7%
      +1.7%     +16 grpc_server_shutdown_and_notify                                                          +16  +1.7%
      +2.3%     +11 queue_call_request                                                                       +11  +2.3%
      +8.1%     +11 request_matcher_zombify_all_pending_calls((anonymous namespace)::request_matcher*) [     +11  +8.1%
      +3.9%      +8 init_channel_elem                                                                         +8  +3.9%
      +1.4%      +8 grpc_server_start                                                                         +8  +1.4%
  +3.9%    +130 src/core/ext/filters/http/message_compress/message_compress_filter.cc                   +130  +3.9%
       +95%    +138 init_call_elem                                                                          +138   +95%
  +0.8%    +128 src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc                          +128  +0.8%
      +3.2%     +33 grpc_core::(anonymous namespace)::GrpcLbFactory::CreateLoadBalancingPolicy(grpc_core     +33  +3.2%
      +2.0%     +32 grpc_core::(anonymous namespace)::GrpcLb::StartBalancerCallLocked                        +32  +2.0%
      +0.8%     +16 grpc_core::(anonymous namespace)::GrpcLb::CreateOrUpdateRoundRobinPolicyLocked() [cl     +16  +0.8%
      +4.3%     +16 grpc_core::(anonymous namespace)::GrpcLb::~GrpcLb                                        +16  +4.3%
      +9.2%     +11 grpc_core::(anonymous namespace)::GrpcLb::BalancerCallState::ScheduleNextClientLoadR     +11  +9.2%
      +6.1%     +11 grpc_core::(anonymous namespace)::GrpcLb::StartPickingLocked                             +11  +6.1%
      +2.6%      +8 grpc_core::(anonymous namespace)::GrpcLb::PickLocked                                      +8  +2.6%
      +1.4%      +8 grpc_core::(anonymous namespace)::GrpcLb::BalancerCallState::SendClientLoadReportLoc      +8  +1.4%
  +0.8%    +128 src/core/ext/filters/client_channel/lb_policy/xds/xds.cc                                +128  +0.8%
      +3.2%     +33 grpc_core::(anonymous namespace)::XdsFactory::CreateLoadBalancingPolicy(grpc_core::L     +33  +3.2%
      +2.0%     +32 grpc_core::(anonymous namespace)::XdsLb::StartBalancerCallLocked                         +32  +2.0%
      +0.9%     +16 grpc_core::(anonymous namespace)::XdsLb::CreateOrUpdateRoundRobinPolicyLocked() [clo     +16  +0.9%
      +4.3%     +16 grpc_core::(anonymous namespace)::XdsLb::~XdsLb                                          +16  +4.3%
      +9.2%     +11 grpc_core::(anonymous namespace)::XdsLb::BalancerCallState::ScheduleNextClientLoadRe     +11  +9.2%
      +6.1%     +11 grpc_core::(anonymous namespace)::XdsLb::StartPickingLocked                              +11  +6.1%
      +2.6%      +8 grpc_core::(anonymous namespace)::XdsLb::PickLocked                                       +8  +2.6%
      +1.4%      +8 grpc_core::(anonymous namespace)::XdsLb::BalancerCallState::SendClientLoadReportLock      +8  +1.4%
  +2.8%    +128 src/core/ext/filters/http/server/http_server_filter.cc                                  +128  +2.8%
      [NEW] +2.52Ki hs_filter_incoming_metadata(grpc_call_element*, grpc_metadata_batch*) [clone .isra.6 +2.52Ki  [NEW]
      +115%    +124 hs_init_call_elem                                                                       +124  +115%
      +4.5%      +4 [Unmapped]                                                                                +4  +4.5%
  +5.2%    +112 src/core/ext/filters/deadline/deadline_filter.cc                                        +112  +5.2%
      [NEW]    +261 start_timer_if_needed(grpc_call_element*, long) [clone .part.3]                         +261  [NEW]
      [NEW]    +146 grpc_deadline_state::grpc_deadline_state                                                +146  [NEW]
      [NEW]     +32 grpc_deadline_state::~grpc_deadline_state                                                +32  [NEW]
       +89%     +24 init_call_elem                                                                           +24   +89%
      +6.5%     +16 server_start_transport_stream_op_batch                                                   +16  +6.5%
      +7.7%      +8 grpc_deadline_state_client_start_transport_stream_op_batch                                +8  +7.7%
      +3.0%      +8 timer_callback                                                                            +8  +3.0%
      +6.7%      +8 send_cancel_op_in_call_combiner                                                           +8  +6.7%
       +80%      +4 destroy_call_elem                                                                         +4   +80%
      +1.3%      +2 [Unmapped]                                                                                +2  +1.3%
      +1.4%      +2 start_timer_after_init                                                                    +2  +1.4%
  +3.5%    +112 src/core/lib/security/context/security_context.cc                                       +112  +3.5%
      [NEW]     +50 grpc_client_security_context::~grpc_client_security_context                              +50  [NEW]
      +450%     +45 grpc_client_security_context_create                                                      +45  +450%
      [NEW]     +42 grpc_server_security_context::~grpc_server_security_context                              +42  [NEW]
      +370%     +37 grpc_server_security_context_create                                                      +37  +370%
       +16%     +27 [Unmapped]                                                                               +27   +16%
  +1.2%     +96 src/core/lib/iomgr/resource_quota.cc                                                     +96  +1.2%
      +9.7%     +48 grpc_resource_user_create                                                                +48  +9.7%
       +11%     +32 grpc_resource_quota_create                                                               +32   +11%
       +35%     +16 grpc_resource_user_slice_allocator_init                                                  +16   +35%
      +7.1%      +8 grpc_resource_user_shutdown                                                               +8  +7.1%
      +2.5%      +8 grpc_resource_quota_resize                                                                +8  +2.5%
  +0.9%     +88 src/core/ext/filters/client_channel/subchannel.cc                                        +88  +0.9%
      +7.7%     +24 grpc_core::ConnectedSubchannel::CreateCall                                               +24  +7.7%
      +0.9%     +16 grpc_subchannel_create                                                                   +16  +0.9%
      +1.0%     +16 on_subchannel_connected                                                                  +16  +1.0%
      +4.1%     +16 maybe_start_connecting_locked                                                            +16  +4.1%
      +8.0%      +8 grpc_subchannel_weak_unref                                                                +8  +8.0%
      +3.7%      +8 grpc_subchannel_call_process_op                                                           +8  +3.7%
  +2.8%     +80 src/core/ext/filters/max_age/max_age_filter.cc                                           +80  +2.8%
      +8.9%     +72 init_channel_elem                                                                        +72  +8.9%
      +5.9%      +8 [Unmapped]                                                                                +8  +5.9%
  +1.3%     +80 src/core/lib/iomgr/udp_server.cc                                                         +80  +1.3%
       +10%     +25 GrpcUdpListener::StartListening                                                          +25   +10%
       +11%     +22 GrpcUdpListener::OnFdAboutToOrphan                                                       +22   +11%
      +7.5%     +16 GrpcUdpListener::OnRead                                                                  +16  +7.5%
      +7.9%     +16 GrpcUdpListener::do_write                                                                +16  +7.9%
      +9.5%     +11 GrpcUdpListener::OrphanFd                                                                +11  +9.5%
      +4.5%      +8 GrpcUdpListener::OnCanWrite                                                               +8  +4.5%

 -------------- SHRINKING                                                                            --------------
 -17.7%     -64 src/core/ext/transport/chttp2/transport/incoming_metadata.cc                             -64 -17.7%
      [DEL]     -35 grpc_chttp2_incoming_metadata_buffer_init                                                -35  [DEL]
     -48.8%     -20 [Unmapped]                                                                               -20 -48.8%
      [DEL]      -9 grpc_chttp2_incoming_metadata_buffer_destroy                                              -9  [DEL]
  -1.4%     -52 src/core/lib/security/transport/secure_endpoint.cc                                       -52  -1.4%
      [DEL]    -256 call_read_cb                                                                            -256  [DEL]
      [DEL]    -221 flush_write_staging_buffer                                                              -221  [DEL]
      [DEL]    -151 destroy                                                                                 -151  [DEL]
     -87.8%     -36 endpoint_destroy                                                                         -36 -87.8%
      -5.2%     -20 grpc_secure_endpoint_create                                                              -20  -5.2%
  -1.0%     -32 src/core/ext/transport/chttp2/transport/frame_data.cc                                    -32  -1.0%
      [DEL]    -191 grpc_chttp2_data_parser_destroy                                                         -191  [DEL]
      [DEL]     -17 grpc_chttp2_data_parser_init                                                             -17  [DEL]
     -44.1%     -15 [Unmapped]                                                                               -15 -44.1%

  +0.6% +8.56Ki TOTAL                                                                                +68.5Ki  +0.6%


****************************************************************

libgrpc++.so

     VM SIZE              FILE SIZE
 ++++++++++++++ GROWIN ++++++++++++++
  [ = ]       0 [None]    +736  +0.0%

  [ = ]       0 TOTAL     +736  +0.0%



@grpc-testing
Copy link
Copy Markdown

[trickle] No significant performance differences

@grpc-testing
Copy link
Copy Markdown

Objective-C binary sizes
*****************STATIC******************
  New size                      Old size
   731,375       Core (>)        727,548

 2,020,616      Total (>)      2,016,505

***************FRAMEWORKS****************
  New size                      Old size
 3,974,206       Core (>)      3,916,346

11,180,937      Total (>)     11,123,081


@grpc-testing
Copy link
Copy Markdown

Corrupt JSON data (indicates timeout or crash): 
    bm_call_create.BM_IsolatedFilter_ClientChannelFilter_NoOp_.counters.new: 10
    bm_call_create.BM_IsolatedFilter_ClientChannelFilter_NoOp_.counters.old: 10


[microbenchmarks] Performance differences noted:
Benchmark                                                                            allocs_per_iteration    cpu_time    real_time
-----------------------------------------------------------------------------------  ----------------------  ----------  -----------
BM_HpackParserParseHeader<AddIndexedSingleInternedElem, UnrefHeader>                                         -57%        -57%
BM_HpackParserParseHeader<AddIndexedSingleStaticElem, UnrefHeader>                                           -68%        -68%
BM_HpackParserParseHeader<EmptyBatch, UnrefHeader>                                                           -96%        -96%
BM_HpackParserParseHeader<IndexedSingleInternedElem, UnrefHeader>                                            -87%        -87%
BM_HpackParserParseHeader<IndexedSingleStaticElem, UnrefHeader>                                              -93%        -93%
BM_HpackParserParseHeader<KeyIndexedSingleInternedElem, UnrefHeader>                                         -61%        -61%
BM_HpackParserParseHeader<KeyIndexedSingleStaticElem, UnrefHeader>                                           -57%        -57%
BM_HpackParserParseHeader<MoreRepresentativeClientInitialMetadata, OnInitialHeader>                          -18%        -18%
BM_HpackParserParseHeader<MoreRepresentativeClientInitialMetadata, UnrefHeader>                              -31%        -31%
BM_HpackParserParseHeader<NonIndexedBinaryElem<1, false>, UnrefHeader>                                       -61%        -61%
BM_HpackParserParseHeader<NonIndexedBinaryElem<1, true>, UnrefHeader>                                        -61%        -61%
BM_HpackParserParseHeader<NonIndexedBinaryElem<10, false>, UnrefHeader>                                      -48%        -48%
BM_HpackParserParseHeader<NonIndexedBinaryElem<10, true>, UnrefHeader>                                       -52%        -52%
BM_HpackParserParseHeader<NonIndexedBinaryElem<100, false>, UnrefHeader>                                     -4%         -4%
BM_HpackParserParseHeader<NonIndexedBinaryElem<100, true>, UnrefHeader>                                      -58%        -58%
BM_HpackParserParseHeader<NonIndexedBinaryElem<3, false>, UnrefHeader>                                       -54%        -54%
BM_HpackParserParseHeader<NonIndexedBinaryElem<3, true>, UnrefHeader>                                        -60%        -60%
BM_HpackParserParseHeader<NonIndexedBinaryElem<31, false>, UnrefHeader>                                      -21%        -21%
BM_HpackParserParseHeader<NonIndexedBinaryElem<31, true>, UnrefHeader>                                       -53%        -53%
BM_HpackParserParseHeader<NonIndexedElem, UnrefHeader>                                                       -49%        -49%
BM_HpackParserParseHeader<RepresentativeClientInitialMetadata, OnInitialHeader>                              -34%        -34%
BM_HpackParserParseHeader<RepresentativeClientInitialMetadata, UnrefHeader>                                  -66%        -66%
BM_HpackParserParseHeader<RepresentativeServerInitialMetadata, OnInitialHeader>                              -62%        -62%
BM_HpackParserParseHeader<RepresentativeServerInitialMetadata, UnrefHeader>                                  -84%        -84%
BM_HpackParserParseHeader<RepresentativeServerTrailingMetadata, UnrefHeader>                                 -82%        -82%
BM_HpackParserParseHeader<SameDeadline, OnHeaderTimeout>                                                     -69%        -69%
BM_IsolatedFilter<HttpClientFilter, NoOp>                                                                    +9%         +9%
BM_LameChannelCallCreateCore                                                         -6%
BM_LameChannelCallCreateCoreSeparateBatch                                            -5%
BM_LameChannelCallCreateCpp                                                          -5%
BM_WellFlushed                                                                                               +20%        +20%

@soheilhy
Copy link
Copy Markdown
Contributor Author

soheilhy commented Nov 5, 2018

The only test failure was a tool failure. So, I think we can ignore.

@soheilhy soheilhy merged commit b41a44d into grpc:master Nov 5, 2018
@soheilhy soheilhy added release notes: yes Indicates if PR needs to be in release notes and removed release notes: no Indicates if PR should not be in release notes labels Nov 27, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Feb 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lang/core release notes: yes Indicates if PR needs to be in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants