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 #ifdef EINA_BENCH_HAVE_GLIB
31 #include "Evas_Data.h"
32 #include "Ecore_Data.h"
36 #if EINA_ENABLE_BENCH_E17
38 typedef struct _Eina_Stringshare_Test Eina_Stringshare_Test;
39 struct _Eina_Stringshare_Test
44 const char *(*add)(const char *str);
45 void (*del)(const char *str);
46 int (*shutdown)(void);
49 static const char *strings[30000];
50 static Eina_Stringshare_Test eina_str = {
58 static Eina_Stringshare_Test evas_str = {
60 /* evas_stringshare_init, */
63 /* evas_stringshare_shutdown */
66 static Eina_Stringshare_Test ecore_str = {
69 ecore_string_instance,
74 static Eina_Stringshare_Test *str[] = {
82 eina_bench_e17_stringshare(Eina_Stringshare_Test *str)
86 cnt = eina_counter_new(str->name);
88 eina_counter_start(cnt);
96 eina_counter_stop(cnt, 1);
98 fprintf(stderr, "For `%s`:\n", str->name);
99 eina_counter_dump(cnt);
101 eina_counter_free(cnt);
108 #if EINA_ENABLE_BENCH_E17
113 for (i = 0; str[i]; ++i)
114 eina_bench_e17_stringshare(str[i]);