summaryrefslogtreecommitdiff
path: root/src/benchmarks/eo/eo_bench_eo_do.c
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2015-10-14 10:54:02 +0100
committerTom Hacohen <tom@stosb.com>2015-11-09 11:43:04 +0000
commit862372ed2316d23e657f3562a4d5c77d05bd8849 (patch)
treee9dc064bb0a2de6982bc138108a88968920c29d3 /src/benchmarks/eo/eo_bench_eo_do.c
parent9f6ec045a7e5d9a1f1be360e282051821a4c4cc6 (diff)
Eo benchmarks: Improve benchmarks.
Add more cases, and tune the number of times we test.
Diffstat (limited to '')
-rw-r--r--src/benchmarks/eo/eo_bench_eo_do.c43
1 files changed, 39 insertions, 4 deletions
diff --git a/src/benchmarks/eo/eo_bench_eo_do.c b/src/benchmarks/eo/eo_bench_eo_do.c
index 36abc1417a..2bcdc4246e 100644
--- a/src/benchmarks/eo/eo_bench_eo_do.c
+++ b/src/benchmarks/eo/eo_bench_eo_do.c
@@ -7,7 +7,7 @@
7#include "class_simple.h" 7#include "class_simple.h"
8 8
9static void 9static void
10bench_eo_do_general(int request) 10bench_eo_do_simple(int request)
11{ 11{
12 int i; 12 int i;
13 Eo *obj = eo_add(SIMPLE_CLASS, NULL); 13 Eo *obj = eo_add(SIMPLE_CLASS, NULL);
@@ -19,6 +19,37 @@ bench_eo_do_general(int request)
19 eo_unref(obj); 19 eo_unref(obj);
20} 20}
21 21
22static void
23bench_eo_do_two_objs(int request)
24{
25 int i;
26 Eo *obj = eo_add(SIMPLE_CLASS, NULL);
27 Eo *obj2 = eo_add(SIMPLE_CLASS, NULL);
28 for (i = 0 ; i < request ; i++)
29 {
30 eo_do(obj, simple_a_set(i));
31 eo_do(obj2, simple_a_set(i));
32 }
33
34 eo_unref(obj);
35 eo_unref(obj2);
36}
37
38static void
39bench_eo_do_two_objs_growing_stack(int request)
40{
41 int i;
42 Eo *obj = eo_add(SIMPLE_CLASS, NULL);
43 Eo *obj2 = eo_add(SIMPLE_CLASS, NULL);
44 for (i = 0 ; i < request ; i++)
45 {
46 eo_do(obj, simple_other_call(obj2, 20));
47 }
48
49 eo_unref(obj);
50 eo_unref(obj2);
51}
52
22static const Eo_Class *cur_klass; 53static const Eo_Class *cur_klass;
23 54
24static void 55static void
@@ -58,8 +89,12 @@ bench_eo_do_super(int request)
58 89
59void eo_bench_eo_do(Eina_Benchmark *bench) 90void eo_bench_eo_do(Eina_Benchmark *bench)
60{ 91{
61 eina_benchmark_register(bench, "various", 92 eina_benchmark_register(bench, "simple",
62 EINA_BENCHMARK(bench_eo_do_general), 1000, 100000, 500); 93 EINA_BENCHMARK(bench_eo_do_simple), _EO_BENCH_TIMES(1000, 10, 500000));
63 eina_benchmark_register(bench, "super", 94 eina_benchmark_register(bench, "super",
64 EINA_BENCHMARK(bench_eo_do_super), 1000, 100000, 500); 95 EINA_BENCHMARK(bench_eo_do_super), _EO_BENCH_TIMES(1000, 10, 500000));
96 eina_benchmark_register(bench, "two_objs",
97 EINA_BENCHMARK(bench_eo_do_two_objs), _EO_BENCH_TIMES(1000, 10, 500000));
98 eina_benchmark_register(bench, "two_objs_growing_stack",
99 EINA_BENCHMARK(bench_eo_do_two_objs_growing_stack), _EO_BENCH_TIMES(1000, 10, 40000));
65} 100}