MCPcopy Create free account
hub / github.com/apache/qpid-proton / BM_CreateListMessage

Function BM_CreateListMessage

c/benchmarks/message-encoding_list.cpp:107–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105 ->Unit(benchmark::kMillisecond);
106
107static void BM_CreateListMessage(benchmark::State &state) {
108 if (VERBOSE)
109 printf("BEGIN BM_CreateListMessage\n");
110
111 uint64_t entries = 0;
112
113 pn_message_t *message = pn_message();
114 pn_data_t *body;
115 body = pn_message_body(message);
116 pn_data_put_list(body);
117 pn_data_enter(body);
118 for (auto _ : state) {
119 pn_data_put_string(
120 body, pn_bytes(sizeof("some list value") - 1, "some list value"));
121 pn_data_put_int(body, 42);
122 entries += 2;
123 }
124 pn_data_exit(body);
125 pn_message_free(message);
126
127 state.SetLabel("entries");
128 state.SetItemsProcessed(entries);
129
130 if (VERBOSE)
131 printf("END BM_CreateListMessage\n");
132}
133
134BENCHMARK(BM_CreateListMessage);

Callers

nothing calls this directly

Calls 9

pn_messageFunction · 0.85
pn_message_bodyFunction · 0.85
pn_data_put_listFunction · 0.85
pn_data_enterFunction · 0.85
pn_data_put_intFunction · 0.85
pn_data_exitFunction · 0.85
pn_message_freeFunction · 0.85
pn_data_put_stringFunction · 0.50
pn_bytesFunction · 0.50

Tested by

no test coverage detected