aboutsummaryrefslogtreecommitdiffstats
path: root/src/benchmarks
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-11-01 21:57:43 -0200
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-11-01 21:57:43 -0200
commitfa88a2337f4c1ed74dbe5f8e9b8ab9e80aa94215 (patch)
tree289d1f0e30abe7aeb9100ab9ed3e3a755d1c18b7 /src/benchmarks
parentEo do: use the __thread directive when available to manage call stack. (diff)
downloadefl-fa88a2337f4c1ed74dbe5f8e9b8ab9e80aa94215.tar.gz
Eo: Partial implementation to remove eo_dodevs/felipealmeida/eo_optimisations
Diffstat (limited to 'src/benchmarks')
-rw-r--r--src/benchmarks/eo/class_simple.c2
-rw-r--r--src/benchmarks/eo/eo_bench_callbacks.c14
-rw-r--r--src/benchmarks/eo/eo_bench_eo_add.c6
-rw-r--r--src/benchmarks/eo/eo_bench_eo_do.c30
4 files changed, 30 insertions, 22 deletions
diff --git a/src/benchmarks/eo/class_simple.c b/src/benchmarks/eo/class_simple.c
index 0a57e285fa..a4482726c3 100644
--- a/src/benchmarks/eo/class_simple.c
+++ b/src/benchmarks/eo/class_simple.c
@@ -15,7 +15,7 @@ _other_call(Eo *obj EINA_UNUSED, void *class_data EINA_UNUSED, Eo *other, int ti
{
if (times > 0)
{
- eo_do(other, simple_other_call(obj, times-1));
+ simple_other_call(other, obj, times-1);
}
}
diff --git a/src/benchmarks/eo/eo_bench_callbacks.c b/src/benchmarks/eo/eo_bench_callbacks.c
index fde611eea1..eac192572b 100644
--- a/src/benchmarks/eo/eo_bench_callbacks.c
+++ b/src/benchmarks/eo/eo_bench_callbacks.c
@@ -17,11 +17,12 @@ static void
bench_eo_callbacks_add(int request)
{
int i;
- Eo *obj = eo_add(SIMPLE_CLASS, NULL);
+ Eo *obj;
+ eo_add(obj, SIMPLE_CLASS, NULL);
for (i = 0 ; i < request ; i++)
{
- eo_do(obj, eo_event_callback_priority_add(SIMPLE_FOO, (short) i, _cb, NULL));
+ eo_event_callback_priority_add(obj, SIMPLE_FOO, (short) i, _cb, NULL);
}
eo_unref(obj);
@@ -50,14 +51,15 @@ bench_eo_callbacks_call(int request)
const int len = EINA_C_ARRAY_LENGTH(distribution);
int i, j;
- Eo *obj[len] = { 0 };
+ Eo *obj[len];
for (i = 0 ; i < len ; i++)
{
- obj[i] = eo_add(SIMPLE_CLASS, NULL);
+ ///obj[i];
+ eo_add(obj[i], SIMPLE_CLASS, NULL);
for (j = 0 ; j < i ; j++)
{
- eo_do(obj[i], eo_event_callback_priority_add(SIMPLE_FOO, (short) j, _cb, NULL));
+ eo_event_callback_priority_add(obj[i], SIMPLE_FOO, (short) j, _cb, NULL);
}
}
@@ -66,7 +68,7 @@ bench_eo_callbacks_call(int request)
for (j = 0 ; j < (int) (distribution[i] * request) ; j++)
{
/* Miss finding the callbacks on purpose, so we measure worst case scenario. */
- eo_do(obj[i], eo_event_callback_call(SIMPLE_BAR, NULL));
+ eo_event_callback_call(obj[i], SIMPLE_BAR, NULL);
}
}
diff --git a/src/benchmarks/eo/eo_bench_eo_add.c b/src/benchmarks/eo/eo_bench_eo_add.c
index 462f3b9c56..6f25ce9efd 100644
--- a/src/benchmarks/eo/eo_bench_eo_add.c
+++ b/src/benchmarks/eo/eo_bench_eo_add.c
@@ -12,7 +12,7 @@ bench_eo_add_linear(int request)
int i;
Eo **objs = calloc(request, sizeof(Eo *));
for (i = 0 ; i < request ; i++)
- objs[i] = eo_add(SIMPLE_CLASS, NULL);
+ eo_add(objs[i], SIMPLE_CLASS, NULL);
for (i = 0 ; i < request ; i++)
eo_unref(objs[i]);
@@ -25,13 +25,13 @@ bench_eo_add_jump_by_2(int request)
int i;
Eo **objs = calloc(request, sizeof(Eo *));
for (i = 0 ; i < request ; i++)
- objs[i] = eo_add(SIMPLE_CLASS, NULL);
+ eo_add(objs[i], SIMPLE_CLASS, NULL);
for (i = 0 ; i < request ; i += 2)
eo_unref(objs[i]);
for (i = 0 ; i < request ; i += 2)
- objs[i] = eo_add(SIMPLE_CLASS, NULL);
+ eo_add(objs[i], SIMPLE_CLASS, NULL);
for (i = 0 ; i < request ; i++)
eo_unref(objs[i]);
diff --git a/src/benchmarks/eo/eo_bench_eo_do.c b/src/benchmarks/eo/eo_bench_eo_do.c
index 2bcdc4246e..adb6851f32 100644
--- a/src/benchmarks/eo/eo_bench_eo_do.c
+++ b/src/benchmarks/eo/eo_bench_eo_do.c
@@ -10,10 +10,11 @@ static void
bench_eo_do_simple(int request)
{
int i;
- Eo *obj = eo_add(SIMPLE_CLASS, NULL);
+ Eo *obj;
+ eo_add(obj, SIMPLE_CLASS, NULL);
for (i = 0 ; i < request ; i++)
{
- eo_do(obj, simple_a_set(i));
+ simple_a_set(obj, i);
}
eo_unref(obj);
@@ -23,12 +24,14 @@ static void
bench_eo_do_two_objs(int request)
{
int i;
- Eo *obj = eo_add(SIMPLE_CLASS, NULL);
- Eo *obj2 = eo_add(SIMPLE_CLASS, NULL);
+ Eo *obj;
+ eo_add(obj, SIMPLE_CLASS, NULL);
+ Eo *obj2;
+ eo_add(obj2, SIMPLE_CLASS, NULL);
for (i = 0 ; i < request ; i++)
{
- eo_do(obj, simple_a_set(i));
- eo_do(obj2, simple_a_set(i));
+ simple_a_set(obj, i);
+ simple_a_set(obj2, i);
}
eo_unref(obj);
@@ -39,11 +42,13 @@ static void
bench_eo_do_two_objs_growing_stack(int request)
{
int i;
- Eo *obj = eo_add(SIMPLE_CLASS, NULL);
- Eo *obj2 = eo_add(SIMPLE_CLASS, NULL);
+ Eo *obj;
+ eo_add(obj, SIMPLE_CLASS, NULL);
+ Eo *obj2;
+ eo_add(obj2, SIMPLE_CLASS, NULL);
for (i = 0 ; i < request ; i++)
{
- eo_do(obj, simple_other_call(obj2, 20));
+ simple_other_call(obj, obj2, 20);
}
eo_unref(obj);
@@ -55,7 +60,7 @@ static const Eo_Class *cur_klass;
static void
_a_set(Eo *obj, void *class_data EINA_UNUSED, int a)
{
- eo_do_super(obj, cur_klass, simple_a_set(a));
+ eo_super_simple_a_set(cur_klass, obj, a);
}
static Eo_Op_Description op_desc[] = {
@@ -78,10 +83,11 @@ bench_eo_do_super(int request)
cur_klass = eo_class_new(&class_desc, SIMPLE_CLASS, NULL);
int i;
- Eo *obj = eo_add(cur_klass, NULL);
+ Eo *obj;
+ eo_add(obj, cur_klass, NULL);
for (i = 0 ; i < request ; i++)
{
- eo_do(obj, simple_a_set(i));
+ simple_a_set(obj, i);
}
eo_unref(obj);