I have a piece of code written in C and I want to find the bottleneck for this code! Using perf tool and annotating the assembly code, I see the push %r12 instruction at the start of the function is being the bottleneck (see the picture):
I'm a bit confused with that! How a simple push instruction leads to be a bottleneck? Is it possible that CPU is forced to update the content on memory from cache before pushing the register content to the stack? If yes, I would appreciate if you let me know what is the reason behind that.
This is the input parameters for my function, in case it is required:
nt32_t
rte_hash_lookup(const struct rte_hash *h, const void *key)
{
RETURN_IF_TRUE(((h == NULL) || (key == NULL)), -EINVAL);
return __rte_hash_lookup_with_hash(h, key, rte_hash_hash(h, key), NULL);
}