summaryrefslogtreecommitdiff
path: root/legacy/eina/src/tests/eina_bench_hash.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2008-10-06 14:48:13 +0000
committerCedric BAIL <cedric.bail@free.fr>2008-10-06 14:48:13 +0000
commitd3ba8a9e2e1dbe5ec49e11713bc34cb4dffa5e6a (patch)
treed7106470ae2bc417dc79a34a8d3228521533c4c0 /legacy/eina/src/tests/eina_bench_hash.c
parent195b2da18875048718f509b5139da0d213096c1c (diff)
Actually bench djb2 inline and not superfast hash function.
SVN revision: 36480
Diffstat (limited to '')
-rw-r--r--legacy/eina/src/tests/eina_bench_hash.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/legacy/eina/src/tests/eina_bench_hash.c b/legacy/eina/src/tests/eina_bench_hash.c
index 6874806621..6b4a3d8ff4 100644
--- a/legacy/eina/src/tests/eina_bench_hash.c
+++ b/legacy/eina/src/tests/eina_bench_hash.c
@@ -214,7 +214,7 @@ eina_bench_lookup_djb2_inline(int request)
214 length = eina_convert_itoa(i, elm->key) + 1; 214 length = eina_convert_itoa(i, elm->key) + 1;
215 elm->value = i; 215 elm->value = i;
216 216
217 eina_hash_direct_add_by_hash(hash, elm->key, length, eina_hash_superfast(elm->key, length), elm); 217 eina_hash_direct_add_by_hash(hash, elm->key, length, eina_hash_djb2(elm->key, length), elm);
218 } 218 }
219 219
220 srand(time(NULL)); 220 srand(time(NULL));
@@ -227,7 +227,7 @@ eina_bench_lookup_djb2_inline(int request)
227 227
228 length = eina_convert_itoa(rand() % request, tmp_key) + 1; 228 length = eina_convert_itoa(rand() % request, tmp_key) + 1;
229 229
230 elm = eina_hash_find_by_hash(hash, tmp_key, length, eina_hash_superfast(tmp_key, length)); 230 elm = eina_hash_find_by_hash(hash, tmp_key, length, eina_hash_djb2(tmp_key, length));
231 } 231 }
232 232
233 eina_hash_free(hash); 233 eina_hash_free(hash);
@@ -381,17 +381,17 @@ eina_bench_lookup_ecore(int request)
381 381
382void eina_bench_hash(Eina_Benchmark *bench) 382void eina_bench_hash(Eina_Benchmark *bench)
383{ 383{
384 eina_benchmark_register(bench, "superfast-lookup", EINA_BENCHMARK(eina_bench_lookup_superfast), 10, 2000, 10); 384 eina_benchmark_register(bench, "superfast-lookup", EINA_BENCHMARK(eina_bench_lookup_superfast), 10, 3000, 10);
385 eina_benchmark_register(bench, "djb2-lookup", EINA_BENCHMARK(eina_bench_lookup_djb2), 10, 2000, 10); 385 eina_benchmark_register(bench, "djb2-lookup", EINA_BENCHMARK(eina_bench_lookup_djb2), 10, 3000, 10);
386 eina_benchmark_register(bench, "djb2-lookup-inline", EINA_BENCHMARK(eina_bench_lookup_djb2_inline), 10, 2000, 10); 386 eina_benchmark_register(bench, "djb2-lookup-inline", EINA_BENCHMARK(eina_bench_lookup_djb2_inline), 10, 3000, 10);
387 eina_benchmark_register(bench, "rbtree", EINA_BENCHMARK(eina_bench_lookup_rbtree), 10, 2000, 10); 387 eina_benchmark_register(bench, "rbtree", EINA_BENCHMARK(eina_bench_lookup_rbtree), 10, 3000, 10);
388#ifdef EINA_BENCH_HAVE_GLIB 388#ifdef EINA_BENCH_HAVE_GLIB
389 eina_benchmark_register(bench, "ghash-lookup", EINA_BENCHMARK(eina_bench_lookup_ghash), 10, 2000, 10); 389 eina_benchmark_register(bench, "ghash-lookup", EINA_BENCHMARK(eina_bench_lookup_ghash), 10, 3000, 10);
390#endif 390#endif
391#ifdef EINA_BENCH_HAVE_EVAS 391#ifdef EINA_BENCH_HAVE_EVAS
392 eina_benchmark_register(bench, "evas-lookup", EINA_BENCHMARK(eina_bench_lookup_evas), 10, 2000, 10); 392 eina_benchmark_register(bench, "evas-lookup", EINA_BENCHMARK(eina_bench_lookup_evas), 10, 3000, 10);
393#endif 393#endif
394#ifdef EINA_BENCH_HAVE_ECORE 394#ifdef EINA_BENCH_HAVE_ECORE
395 eina_benchmark_register(bench, "ecore-lookup", EINA_BENCHMARK(eina_bench_lookup_ecore), 10, 2000, 10); 395 eina_benchmark_register(bench, "ecore-lookup", EINA_BENCHMARK(eina_bench_lookup_ecore), 10, 3000, 10);
396#endif 396#endif
397} 397}