2012-08-26 06:18:44 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2012-09-04 00:03:02 -07:00
|
|
|
# include <config.h>
|
2012-08-26 06:18:44 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "Eo.h"
|
|
|
|
#include "eo_bench.h"
|
|
|
|
#include "class_simple.h"
|
|
|
|
|
|
|
|
static void
|
|
|
|
bench_eo_do_general(int request)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
Eo *obj = eo_add(SIMPLE_CLASS, NULL);
|
|
|
|
for (i = 0 ; i < request ; i++)
|
|
|
|
{
|
|
|
|
eo_do(obj, simple_a_set(i));
|
|
|
|
}
|
|
|
|
|
|
|
|
eo_unref(obj);
|
|
|
|
}
|
|
|
|
|
2013-09-27 08:26:25 -07:00
|
|
|
static const Eo_Class *cur_klass;
|
2013-03-13 09:32:04 -07:00
|
|
|
|
|
|
|
static void
|
2014-04-23 01:23:39 -07:00
|
|
|
_a_set(Eo *obj, void *class_data EINA_UNUSED, int a)
|
2013-03-13 09:32:04 -07:00
|
|
|
{
|
|
|
|
eo_do_super(obj, cur_klass, simple_a_set(a));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
bench_eo_do_super(int request)
|
|
|
|
{
|
|
|
|
static Eo_Class_Description class_desc = {
|
|
|
|
EO_VERSION,
|
|
|
|
"Simple2",
|
|
|
|
EO_CLASS_TYPE_REGULAR,
|
2014-04-23 01:23:39 -07:00
|
|
|
EO_CLASS_DESCRIPTION_NOOPS(),
|
2013-03-13 09:32:04 -07:00
|
|
|
NULL,
|
|
|
|
0,
|
2014-04-23 01:23:39 -07:00
|
|
|
NULL,
|
2013-03-13 09:32:04 -07:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
cur_klass = eo_class_new(&class_desc, SIMPLE_CLASS, NULL);
|
|
|
|
|
|
|
|
int i;
|
|
|
|
Eo *obj = eo_add(cur_klass, NULL);
|
|
|
|
for (i = 0 ; i < request ; i++)
|
|
|
|
{
|
|
|
|
eo_do(obj, simple_a_set(i));
|
|
|
|
}
|
|
|
|
|
|
|
|
eo_unref(obj);
|
|
|
|
}
|
|
|
|
|
2012-08-26 06:18:44 -07:00
|
|
|
void eo_bench_eo_do(Eina_Benchmark *bench)
|
|
|
|
{
|
2012-09-03 00:27:01 -07:00
|
|
|
eina_benchmark_register(bench, "various",
|
2013-03-13 09:40:38 -07:00
|
|
|
EINA_BENCHMARK(bench_eo_do_general), 1000, 100000, 500);
|
2013-03-13 09:32:04 -07:00
|
|
|
eina_benchmark_register(bench, "super",
|
|
|
|
EINA_BENCHMARK(bench_eo_do_super), 1000, 100000, 500);
|
2012-08-26 06:18:44 -07:00
|
|
|
}
|