summaryrefslogtreecommitdiff
path: root/src/benchmarks/eina/eina_bench_promise.c
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2016-06-08 19:33:29 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-06-09 22:38:54 -0300
commit46843551c0af0b58c67cb2f998ece53a32437748 (patch)
tree246303026b113d9f61130c4e0404d521531c3396 /src/benchmarks/eina/eina_bench_promise.c
parent5a3331618e9cf52122a262cd35ab2aee4642d67c (diff)
eina: Remove value type promises
All values in promises are now considered as by-pointer.
Diffstat (limited to '')
-rw-r--r--src/benchmarks/eina/eina_bench_promise.c124
1 files changed, 1 insertions, 123 deletions
diff --git a/src/benchmarks/eina/eina_bench_promise.c b/src/benchmarks/eina/eina_bench_promise.c
index 90a39dfbb8..6baabac9a6 100644
--- a/src/benchmarks/eina/eina_bench_promise.c
+++ b/src/benchmarks/eina/eina_bench_promise.c
@@ -67,7 +67,7 @@ eina_bench_promise_sync_then(int request)
67 67
68 eina_init(); 68 eina_init();
69 69
70 Eina_Promise_Owner* owner = eina_promise_value_add(sizeof(struct value_type)); 70 Eina_Promise_Owner* owner = eina_promise_add();
71 Eina_Promise* promise = eina_promise_owner_promise_get(owner); 71 Eina_Promise* promise = eina_promise_owner_promise_get(owner);
72 eina_promise_ref(promise); 72 eina_promise_ref(promise);
73 73
@@ -87,116 +87,6 @@ eina_bench_promise_sync_then(int request)
87 eina_shutdown(); 87 eina_shutdown();
88} 88}
89 89
90static void
91eina_bench_promise_copy_value_set_after_then(int request)
92{
93 const char *tmp;
94 unsigned int j;
95 int i;
96
97 eina_init();
98
99 struct value_type const v = {0, 0, 0, 0};
100
101 for (j = 0; j != 200; ++j)
102 for (i = 0; i != request; ++i)
103 {
104 Eina_Promise_Owner* owner = eina_promise_value_add(sizeof(struct value_type));
105 Eina_Promise* promise = eina_promise_owner_promise_get(owner);
106
107 eina_promise_then(promise, &cb, NULL, NULL);
108 eina_promise_owner_value_set(owner, &v, NULL);
109 }
110
111 /* Suppress warnings as we really don't want to do anything. */
112 (void) tmp;
113
114 eina_shutdown();
115}
116
117static void
118eina_bench_promise_no_copy_value_set_after_then(int request)
119{
120 const char *tmp;
121 unsigned int j;
122 int i;
123
124 eina_init();
125
126 for (j = 0; j != 200; ++j)
127 for (i = 0; i != request; ++i)
128 {
129 Eina_Promise_Owner* owner = eina_promise_value_add(sizeof(struct value_type));
130 Eina_Promise* promise = eina_promise_owner_promise_get(owner);
131 struct value_type* v = eina_promise_owner_buffer_get(owner);
132
133 eina_promise_then(promise, &cb, NULL, NULL);
134
135 v->x = v->y = v-> w = v->h = 0;
136 eina_promise_owner_value_set(owner, NULL, NULL);
137 }
138
139 /* Suppress warnings as we really don't want to do anything. */
140 (void) tmp;
141
142 eina_shutdown();
143}
144
145static void
146eina_bench_promise_no_copy_value_set_before_then(int request)
147{
148 const char *tmp;
149 unsigned int j;
150 int i;
151
152 eina_init();
153
154 for (j = 0; j != 200; ++j)
155 for (i = 0; i != request; ++i)
156 {
157 Eina_Promise_Owner* owner = eina_promise_value_add(sizeof(struct value_type));
158 Eina_Promise* promise = eina_promise_owner_promise_get(owner);
159 struct value_type* v = eina_promise_owner_buffer_get(owner);
160
161 v->x = v->y = v-> w = v->h = 0;
162 eina_promise_owner_value_set(owner, NULL, NULL);
163
164 eina_promise_then(promise, &cb, NULL, NULL);
165 }
166
167 /* Suppress warnings as we really don't want to do anything. */
168 (void) tmp;
169
170 eina_shutdown();
171}
172
173static void
174eina_bench_promise_copy_value_set_before_then(int request)
175{
176 const char *tmp;
177 unsigned int j;
178 int i;
179
180 eina_init();
181
182 struct value_type const v = {0, 0, 0, 0};
183
184 for (j = 0; j != 200; ++j)
185 for (i = 0; i != request; ++i)
186 {
187 Eina_Promise_Owner* owner = eina_promise_value_add(sizeof(struct value_type));
188 Eina_Promise* promise = eina_promise_owner_promise_get(owner);
189
190 eina_promise_then(promise, &cb, NULL, NULL);
191 eina_promise_owner_value_set(owner, &v, NULL);
192 }
193
194 /* Suppress warnings as we really don't want to do anything. */
195 (void) tmp;
196
197 eina_shutdown();
198}
199
200static void indirect_free(void* p) 90static void indirect_free(void* p)
201{ 91{
202 free(p); 92 free(p);
@@ -398,18 +288,6 @@ void eina_bench_promise(Eina_Benchmark *bench)
398 eina_benchmark_register(bench, "promise synchronous then", 288 eina_benchmark_register(bench, "promise synchronous then",
399 EINA_BENCHMARK( 289 EINA_BENCHMARK(
400 eina_bench_promise_sync_then), 100, 20100, 500); 290 eina_bench_promise_sync_then), 100, 20100, 500);
401 eina_benchmark_register(bench, "promise copy value set after then",
402 EINA_BENCHMARK(
403 eina_bench_promise_copy_value_set_after_then), 100, 20100, 500);
404 eina_benchmark_register(bench, "promise copy value set before then",
405 EINA_BENCHMARK(
406 eina_bench_promise_copy_value_set_before_then), 100, 20100, 500);
407 eina_benchmark_register(bench, "promise no copy value set after then",
408 EINA_BENCHMARK(
409 eina_bench_promise_no_copy_value_set_after_then), 100, 20100, 500);
410 eina_benchmark_register(bench, "promise no copy value set before then",
411 EINA_BENCHMARK(
412 eina_bench_promise_no_copy_value_set_before_then), 100, 20100, 500);
413 eina_benchmark_register(bench, "promise pointer value set after then mempool", 291 eina_benchmark_register(bench, "promise pointer value set after then mempool",
414 EINA_BENCHMARK( 292 EINA_BENCHMARK(
415 eina_bench_promise_pointer_value_set_after_then_pooled), 100, 20100, 500); 293 eina_bench_promise_pointer_value_set_after_then_pooled), 100, 20100, 500);