Enlightenment CVS committal Author : cedric Project : e17 Module : proto/eina
Dir : e17/proto/eina/src/tests Modified Files: eina_test_array.c eina_bench_hash.c eina_bench_array.c Log Message: After benchmarking, providing inline does impact performance of list and array user. =================================================================== RCS file: /cvs/e/e17/proto/eina/src/tests/eina_test_array.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- eina_test_array.c 7 Aug 2008 13:11:13 -0000 1.3 +++ eina_test_array.c 8 Aug 2008 14:20:11 -0000 1.4 @@ -45,10 +45,9 @@ fail_if(atoi(eina_array_get(ea, 10)) != 10); EINA_ARRAY_ITER_NEXT(ea, i, tmp) - { - fail_if((unsigned int) atoi(tmp) != i); - free(tmp); - } + fail_if((unsigned int) atoi(tmp) != i); + free(tmp); + EINA_ARRAY_ITER_END fail_if(i != 200); @@ -83,10 +82,9 @@ fail_if(atoi(eina_array_get(&sea, 10)) != 10); EINA_ARRAY_ITER_NEXT(&sea, i, tmp) - { - fail_if((unsigned int) atoi(tmp) != i); - free(tmp); - } + fail_if((unsigned int) atoi(tmp) != i); + free(tmp); + EINA_ARRAY_ITER_END fail_if(i != 200); @@ -141,6 +139,7 @@ fail_if(eina_array_count(ea) != 990); EINA_ARRAY_ITER_NEXT(ea, i, tmp) fail_if(*tmp == 0); + EINA_ARRAY_ITER_END; // Remove the last items for (i = 980; i < 990; ++i) @@ -158,6 +157,8 @@ fail_if(*tmp == 0); *tmp = 0; } + EINA_ARRAY_ITER_END; + eina_array_remove(ea, keep_int, NULL); fail_if(eina_array_count(ea) != 0); =================================================================== RCS file: /cvs/e/e17/proto/eina/src/tests/eina_bench_hash.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- eina_bench_hash.c 7 Aug 2008 13:14:08 -0000 1.4 +++ eina_bench_hash.c 8 Aug 2008 14:20:11 -0000 1.5 @@ -68,6 +68,7 @@ EINA_ARRAY_ITER_NEXT(array, i, tmp_val) free(tmp_val); + EINA_ARRAY_ITER_END; eina_array_free(array); } @@ -115,6 +116,7 @@ EINA_ARRAY_ITER_NEXT(array, i, tmp_val) free(tmp_val); + EINA_ARRAY_ITER_END; eina_array_free(array); } @@ -164,6 +166,7 @@ EINA_ARRAY_ITER_NEXT(array, i, tmp_val) free(tmp_val); + EINA_ARRAY_ITER_END; eina_array_free(array); } =================================================================== RCS file: /cvs/e/e17/proto/eina/src/tests/eina_bench_array.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- eina_bench_array.c 7 Aug 2008 17:17:18 -0000 1.1 +++ eina_bench_array.c 8 Aug 2008 14:20:11 -0000 1.2 @@ -50,7 +50,7 @@ } static void -eina_bench_array_4evas_render(int request) +eina_bench_array_4evas_render_inline(int request) { Eina_Array *array; Eina_Bench_Object *ebo; @@ -79,16 +79,20 @@ { EINA_ARRAY_ITER_NEXT(array, j, ebo) free(ebo); + EINA_ARRAY_ITER_END; + eina_array_clean(array); } else if (i % 30 == 0) eina_array_remove(array, keep, NULL); EINA_ARRAY_ITER_NEXT(array, j, ebo) ebo->keep = rand() < (RAND_MAX / 2) ? ebo->keep : EINA_FALSE; + EINA_ARRAY_ITER_END; } EINA_ARRAY_ITER_NEXT(array, j, ebo) free(ebo); + EINA_ARRAY_ITER_END; eina_array_free(array); @@ -227,7 +231,7 @@ void eina_bench_array(Eina_Bench *bench) { - eina_bench_register(bench, "array", EINA_BENCH(eina_bench_array_4evas_render), 200, 4000, 100); + eina_bench_register(bench, "array-inline", EINA_BENCH(eina_bench_array_4evas_render_inline), 200, 4000, 100); eina_bench_register(bench, "list", EINA_BENCH(eina_bench_list_4evas_render), 200, 4000, 100); eina_bench_register(bench, "inlist", EINA_BENCH(eina_bench_inlist_4evas_render), 200, 4000, 100); } ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs