It really depends on your code, and without measuring it, you may not know. But overall, you can be sure that the I / O latency far outweighs the time it takes to create callback functions to handle these I / O events. Therefore, in normal scenarios, there is probably no significant (or even not measurable) gain in optimizing callback creation. There are probably other areas where it’s easier to get performance and find them so you can profile your code.
source
share