Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
5bdffab4
Commit
5bdffab4
authored
7 years ago
by
Craig Tiller
Browse files
Options
Downloads
Patches
Plain Diff
Add profiling annotations
parent
a5da6e18
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/cpp/microbenchmarks/bm_call_create.cc
+6
-0
6 additions, 0 deletions
test/cpp/microbenchmarks/bm_call_create.cc
with
6 additions
and
0 deletions
test/cpp/microbenchmarks/bm_call_create.cc
+
6
−
0
View file @
5bdffab4
...
@@ -54,6 +54,7 @@ extern "C" {
...
@@ -54,6 +54,7 @@ extern "C" {
#include
"src/core/lib/channel/http_client_filter.h"
#include
"src/core/lib/channel/http_client_filter.h"
#include
"src/core/lib/channel/http_server_filter.h"
#include
"src/core/lib/channel/http_server_filter.h"
#include
"src/core/lib/channel/message_size_filter.h"
#include
"src/core/lib/channel/message_size_filter.h"
#include
"src/core/lib/profiling/timers.h"
#include
"src/core/lib/surface/channel.h"
#include
"src/core/lib/surface/channel.h"
#include
"src/core/lib/transport/transport_impl.h"
#include
"src/core/lib/transport/transport_impl.h"
}
}
...
@@ -152,6 +153,7 @@ static void BM_LameChannelCallCreateCpp(benchmark::State &state) {
...
@@ -152,6 +153,7 @@ static void BM_LameChannelCallCreateCpp(benchmark::State &state) {
grpc
::
testing
::
EchoResponse
recv_response
;
grpc
::
testing
::
EchoResponse
recv_response
;
grpc
::
Status
recv_status
;
grpc
::
Status
recv_status
;
while
(
state
.
KeepRunning
())
{
while
(
state
.
KeepRunning
())
{
GPR_TIMER_SCOPE
(
"BenchmarkCycle"
,
0
);
grpc
::
ClientContext
cli_ctx
;
grpc
::
ClientContext
cli_ctx
;
auto
reader
=
stub
->
AsyncEcho
(
&
cli_ctx
,
send_request
,
&
cq
);
auto
reader
=
stub
->
AsyncEcho
(
&
cli_ctx
,
send_request
,
&
cq
);
reader
->
Finish
(
&
recv_response
,
&
recv_status
,
tag
(
0
));
reader
->
Finish
(
&
recv_response
,
&
recv_status
,
tag
(
0
));
...
@@ -426,6 +428,7 @@ static void BM_IsolatedFilter(benchmark::State &state) {
...
@@ -426,6 +428,7 @@ static void BM_IsolatedFilter(benchmark::State &state) {
const
int
kArenaSize
=
4096
;
const
int
kArenaSize
=
4096
;
call_args
.
arena
=
gpr_arena_create
(
kArenaSize
);
call_args
.
arena
=
gpr_arena_create
(
kArenaSize
);
while
(
state
.
KeepRunning
())
{
while
(
state
.
KeepRunning
())
{
GPR_TIMER_SCOPE
(
"BenchmarkCycle"
,
0
);
GRPC_ERROR_UNREF
(
grpc_call_stack_init
(
&
exec_ctx
,
channel_stack
,
1
,
GRPC_ERROR_UNREF
(
grpc_call_stack_init
(
&
exec_ctx
,
channel_stack
,
1
,
DoNothing
,
NULL
,
&
call_args
));
DoNothing
,
NULL
,
&
call_args
));
typename
TestOp
::
Op
op
(
&
exec_ctx
,
&
test_op_data
,
call_stack
);
typename
TestOp
::
Op
op
(
&
exec_ctx
,
&
test_op_data
,
call_stack
);
...
@@ -590,6 +593,7 @@ static void BM_IsolatedCall_NoOp(benchmark::State &state) {
...
@@ -590,6 +593,7 @@ static void BM_IsolatedCall_NoOp(benchmark::State &state) {
void
*
method_hdl
=
void
*
method_hdl
=
grpc_channel_register_call
(
fixture
.
channel
(),
"/foo/bar"
,
NULL
,
NULL
);
grpc_channel_register_call
(
fixture
.
channel
(),
"/foo/bar"
,
NULL
,
NULL
);
while
(
state
.
KeepRunning
())
{
while
(
state
.
KeepRunning
())
{
GPR_TIMER_SCOPE
(
"BenchmarkCycle"
,
0
);
grpc_call_destroy
(
grpc_channel_create_registered_call
(
grpc_call_destroy
(
grpc_channel_create_registered_call
(
fixture
.
channel
(),
nullptr
,
GRPC_PROPAGATE_DEFAULTS
,
fixture
.
cq
(),
fixture
.
channel
(),
nullptr
,
GRPC_PROPAGATE_DEFAULTS
,
fixture
.
cq
(),
method_hdl
,
deadline
,
NULL
));
method_hdl
,
deadline
,
NULL
));
...
@@ -628,6 +632,7 @@ static void BM_IsolatedCall_Unary(benchmark::State &state) {
...
@@ -628,6 +632,7 @@ static void BM_IsolatedCall_Unary(benchmark::State &state) {
ops
[
5
].
data
.
recv_status_on_client
.
status_details
=
&
status_details
;
ops
[
5
].
data
.
recv_status_on_client
.
status_details
=
&
status_details
;
ops
[
5
].
data
.
recv_status_on_client
.
trailing_metadata
=
&
recv_trailing_metadata
;
ops
[
5
].
data
.
recv_status_on_client
.
trailing_metadata
=
&
recv_trailing_metadata
;
while
(
state
.
KeepRunning
())
{
while
(
state
.
KeepRunning
())
{
GPR_TIMER_SCOPE
(
"BenchmarkCycle"
,
0
);
grpc_call
*
call
=
grpc_channel_create_registered_call
(
grpc_call
*
call
=
grpc_channel_create_registered_call
(
fixture
.
channel
(),
nullptr
,
GRPC_PROPAGATE_DEFAULTS
,
fixture
.
cq
(),
fixture
.
channel
(),
nullptr
,
GRPC_PROPAGATE_DEFAULTS
,
fixture
.
cq
(),
method_hdl
,
deadline
,
NULL
);
method_hdl
,
deadline
,
NULL
);
...
@@ -670,6 +675,7 @@ static void BM_IsolatedCall_StreamingSend(benchmark::State &state) {
...
@@ -670,6 +675,7 @@ static void BM_IsolatedCall_StreamingSend(benchmark::State &state) {
ops
[
0
].
op
=
GRPC_OP_SEND_MESSAGE
;
ops
[
0
].
op
=
GRPC_OP_SEND_MESSAGE
;
ops
[
0
].
data
.
send_message
.
send_message
=
send_message
;
ops
[
0
].
data
.
send_message
.
send_message
=
send_message
;
while
(
state
.
KeepRunning
())
{
while
(
state
.
KeepRunning
())
{
GPR_TIMER_SCOPE
(
"BenchmarkCycle"
,
0
);
grpc_call_start_batch
(
call
,
ops
,
1
,
tag
(
2
),
NULL
);
grpc_call_start_batch
(
call
,
ops
,
1
,
tag
(
2
),
NULL
);
grpc_completion_queue_next
(
fixture
.
cq
(),
grpc_completion_queue_next
(
fixture
.
cq
(),
gpr_inf_future
(
GPR_CLOCK_MONOTONIC
),
NULL
);
gpr_inf_future
(
GPR_CLOCK_MONOTONIC
),
NULL
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment