MCPcopy Create free account
hub / github.com/F-Stack/f-stack / test_single_push_pop

Function test_single_push_pop

dpdk/app/test/test_stack_perf.c:251–269  ·  view source on GitHub ↗

* Measure the cycle cost of pushing and popping a single pointer on a single * lcore. */

Source from the content-addressed store, hash-verified

249 * lcore.
250 */
251static void
252test_single_push_pop(struct rte_stack *s)
253{
254 unsigned int iterations = 16000000;
255 void *obj = NULL;
256 unsigned int i;
257
258 uint64_t start = rte_rdtsc();
259
260 for (i = 0; i < iterations; i++) {
261 rte_stack_push(s, &obj, 1);
262 rte_stack_pop(s, &obj, 1);
263 }
264
265 uint64_t end = rte_rdtsc();
266
267 printf("Average cycles per single object push/pop: %.2F\n",
268 ((double)(end - start)) / iterations);
269}
270
271/* Measure the cycle cost of bulk pushing and popping on a single lcore. */
272static void

Callers 1

__test_stack_perfFunction · 0.85

Calls 4

rte_stack_pushFunction · 0.85
rte_stack_popFunction · 0.85
rte_rdtscFunction · 0.50
printfFunction · 0.50

Tested by

no test coverage detected