diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-08-06 11:33:41 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2014-08-15 15:07:14 +0200 |
commit | 58803ce74f986785badfb2ef0f630e1cd97f52e5 (patch) | |
tree | 0abc77668bc035fc278cab42371c21162a11a065 /block.c | |
parent | 4f75b52a07e0a0e71c1c81d0cb0ddf9c52c8e1bc (diff) | |
download | hqemu-58803ce74f986785badfb2ef0f630e1cd97f52e5.zip hqemu-58803ce74f986785badfb2ef0f630e1cd97f52e5.tar.gz |
test-coroutine: add baseline test that times the cost of function calls
This can be used to compute the cost of coroutine operations. In the
end the cost of the function call is a few clock cycles, so it's pretty
cheap for now, but it may become more relevant as the coroutine code
is optimized.
For example, here are the results on my machine:
Function call 100000000 iterations: 0.173884 s
Yield 100000000 iterations: 8.445064 s
Lifecycle 1000000 iterations: 0.098445 s
Nesting 10000 iterations of 1000 depth each: 7.406431 s
One yield takes 83 nanoseconds, one enter takes 97 nanoseconds,
one coroutine allocation takes (roughly, since some of the allocations
in the nesting test do hit the pool) 739 nanoseconds:
(8.445064 - 0.173884) * 10^9 / 100000000 = 82.7
(0.098445 * 100 - 0.173884) * 10^9 / 100000000 = 96.7
(7.406431 * 10 - 0.173884) * 10^9 / 100000000 = 738.9
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
0 files changed, 0 insertions, 0 deletions