1 /* EINA - EFL data type library
2 * Copyright (C) 2008 Cedric Bail
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library;
16 * if not, see <http://www.gnu.org/licenses/>.
27 #include "eina_bench.h"
30 typedef struct _Eina_Benchmark_Case Eina_Benchmark_Case;
31 struct _Eina_Benchmark_Case
33 const char *bench_case;
34 void (*build)(Eina_Benchmark *bench);
37 static const Eina_Benchmark_Case etc[] = {
38 { "Hash", eina_bench_hash },
39 /* { "Array vs List vs Inlist", eina_bench_array }, */
40 /* { "Stringshare", eina_bench_stringshare }, */
41 /* { "Convert", eina_bench_convert }, */
42 /* { "Sort", eina_bench_sort }, */
43 /* { "Mempool", eina_bench_mempool }, */
44 /* { "Rectangle_Pool", eina_bench_rectangle_pool }, */
45 // { "Render Loop", eina_bench_quadtree },
49 /* FIXME this is a copy from eina_test_mempool
50 * we should remove the duplication
52 static Eina_Array *_modules;
53 static void _mempool_init(void)
56 /* force modules to be loaded in case they are not installed */
57 _modules = eina_module_list_get(NULL,
58 PACKAGE_BUILD_DIR "/src/modules",
62 eina_module_list_load(_modules);
65 static void _mempool_shutdown(void)
67 eina_module_list_free(_modules);
68 /* TODO delete the list */
73 main(int argc, char **argv)
85 for (i = 0; etc[i].bench_case; ++i)
87 test = eina_benchmark_new(etc[i].bench_case, argv[1]);
93 eina_benchmark_run(test);
95 eina_benchmark_free(test);