[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 20/20] test-coroutine: add performance test for nest
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 20/20] test-coroutine: add performance test for nesting |
Date: |
Mon, 12 Mar 2012 16:19:51 +0100 |
From: Alex Barcelo <address@hidden>
The performance test will also check for nesting. It will do
a certain quantity of cycles, and each of one will do a depth
nesting process.
This is useful for benchmarking the creation of coroutines,
given that nesting is creation-intensive (and the other perf
test does not benchmark that).
Signed-off-by: Alex Barcelo <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
test-coroutine.c | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/test-coroutine.c b/test-coroutine.c
index bf9f3e9..e5d14eb 100644
--- a/test-coroutine.c
+++ b/test-coroutine.c
@@ -177,6 +177,32 @@ static void perf_lifecycle(void)
g_test_message("Lifecycle %u iterations: %f s\n", max, duration);
}
+static void perf_nesting(void)
+{
+ unsigned int i, maxcycles, maxnesting;
+ double duration;
+
+ maxcycles = 100000000;
+ maxnesting = 20000;
+ Coroutine *root;
+ NestData nd = {
+ .n_enter = 0,
+ .n_return = 0,
+ .max = maxnesting,
+ };
+
+ g_test_timer_start();
+ for (i = 0; i < maxcycles; i++) {
+ root = qemu_coroutine_create(nest);
+ qemu_coroutine_enter(root, &nd);
+ }
+ duration = g_test_timer_elapsed();
+
+ g_test_message("Nesting %u iterations of %u depth each: %f s\n",
+ maxcycles, maxnesting, duration);
+}
+
+
int main(int argc, char **argv)
{
g_test_init(&argc, &argv, NULL);
@@ -187,6 +213,7 @@ int main(int argc, char **argv)
g_test_add_func("/basic/in_coroutine", test_in_coroutine);
if (g_test_perf()) {
g_test_add_func("/perf/lifecycle", perf_lifecycle);
+ g_test_add_func("/perf/nesting", perf_nesting);
}
return g_test_run();
}
--
1.7.6.5
- [Qemu-devel] [PATCH 05/20] qcow2: Add error messages in qcow2_truncate, (continued)
- [Qemu-devel] [PATCH 05/20] qcow2: Add error messages in qcow2_truncate, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 06/20] qemu-iotests: Mark some tests as quick, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 02/20] qed: do not evict in-use L2 table cache entries, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 01/20] Group snapshot: Fix format name for backing file, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 16/20] qcow2: Reduce number of I/O requests, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 03/20] qcow2: Add some tracing, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 17/20] coroutine: adding sigaltstack method (.c source), Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 18/20] coroutine: adding configure choose mechanism for coroutine backend, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 10/20] qapi: complete implementation of unions, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 04/20] block: handle -EBUSY in bdrv_commit_all(), Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 20/20] test-coroutine: add performance test for nesting,
Kevin Wolf <=
- [Qemu-devel] [PATCH 07/20] make check: Add qemu-iotests subset, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 14/20] qcow2: Factor out count_cow_clusters, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 09/20] use QSIMPLEQ_FOREACH_SAFE when freeing list elements, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 12/20] add mode field to blockdev-snapshot-sync transaction item, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 19/20] coroutine: adding configure option for sigaltstack coroutine backend, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 13/20] qmp: convert blockdev-snapshot-sync to a wrapper around transactions, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 11/20] rename blockdev-group-snapshot-sync, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 15/20] qcow2: Add qcow2_alloc_clusters_at(), Kevin Wolf, 2012/03/12
- Re: [Qemu-devel] [PULL 00/20] Block patches, Anthony Liguori, 2012/03/12