Thanks for the feed back and perf report. I agree that we should improve it more. I just touched simple redundancies after reading the code.
I also tried profiling but I could not see the root cause quickly. I will analyze more in my free time. Best Regards, Ryuan Choi 2014-02-03 Daniel Juyung Seo <seojuyu...@gmail.com>: > Here is the perf analysis report. > edje part calculation consumes cpu cycle a lot. > > 8.28% elementary_test libedje.so.1.8.99 [.] > _edje_part_recalc_single > 6.69% elementary_test libedje.so.1.8.99 [.] _edje_part_recalc > 5.29% elementary_test libeo.so.1.8.99 [.] > _eo_obj_pointer_get > 4.32% elementary_test libeo.so.1.8.99 [.] _eo_dov_internal > 4.29% elementary_test libedje.so.1.8.99 [.] > _edje_part_recalc_single_min_max > 3.85% elementary_test libedje.so.1.8.99 [.] > _edje_part_recalc_single_rel > 3.75% elementary_test libeo.so.1.8.99 [.] > _eo_data_scope_get > 3.57% elementary_test libeina.so.1.8.99 [.] > eina_hash_superfast > 3.53% elementary_test libeo.so.1.8.99 [.] _dich_func_get > 3.51% elementary_test libedje.so.1.8.99 [.] > _edje_part_recalc_single_aspect > 2.73% elementary_test libeo.so.1.8.99 [.] > _eo_obj_dov_internal > 2.70% elementary_test libeo.so.1.8.99 [.] > _eo_kls_itr_func_get > 2.61% elementary_test libedje.so.1.8.99 [.] > _edje_text_recalc_apply > 2.53% elementary_test libeo.so.1.8.99 [.] _eo_op_internal > 2.42% elementary_test [kernel.kallsyms] [k] 0xc10359d8 > 2.03% elementary_test libeo.so.1.8.99 [.] eo_do_internal > 1.84% elementary_test libeina.so.1.8.99 [.] > _eina_string_key_length > 1.81% elementary_test libedje.so.1.8.99 [.] .L1100 > 1.73% elementary_test libedje.so.1.8.99 [.] > _edje_part_recalc_single_map > 1.60% elementary_test libedje.so.1.8.99 [.] > _edje_part_recalc_single_min_length > 1.30% elementary_test libeo.so.1.8.99 [.] _eo_unref > 1.29% elementary_test libevas.so.1.8.99 [.] .L698 > 1.19% elementary_test libeina.so.1.8.99 [.] eina_hash_find > 0.98% elementary_test libedje.so.1.8.99 [.] > _edje_part_recalc_single_min > 0.88% elementary_test libevas.so.1.8.99 [.] _size_get > 0.86% elementary_test libedje.so.1.8.99 [.] > _edje_part_recalc_single_max > > > 41.75% libedje.so.1.8.99 > 31.72% libeo.so.1.8.99 > 13.19% libevas.so.1.8.99 > 7.78% libeina.so.1.8.99 > 2.42% [kernel.kallsyms] > 1.44% libc-2.15.so > 1.12% libpthread-2.15.so > 0.36% libdbus-1.so.3.5.8 > 0.13% libelementary.so.1.8.99 > 0.06% libecore.so.1.8.99 > 0.02% ld-2.15.so > > Daniel Juyung Seo (SeoZ) > > > > On Mon, Feb 3, 2014 at 10:16 AM, Daniel Juyung Seo <seojuyu...@gmail.com > >wrote: > > > Thanks for the nice patch! > > > > > > > datetime: Refactor to launch test_datetime little bit faster > > > > But the commit message should be changed to something like: > > > datetime: Enhance datetime launching time by reducing redundant > > calculation. > > > > Anyhow, datetime launching time is reduced but it is still slow... hmm. > > Need to analyze it more. > > > > Thanks. > > > > Daniel Juyung Seo (SeoZ) > > > > > > > > On Mon, Feb 3, 2014 at 9:13 AM, Ryuan Choi <ryuan.c...@gmail.com> wrote: > > > >> ryuan pushed a commit to branch master. > >> > >> > >> > http://git.enlightenment.org/core/elementary.git/commit/?id=5cb9d937e6d5f73bd8dba00fdddbc830ab4192af > >> > >> commit 5cb9d937e6d5f73bd8dba00fdddbc830ab4192af > >> Author: Ryuan Choi <ryuan.c...@gmail.com> > >> Date: Mon Feb 3 09:03:26 2014 +0900 > >> > >> datetime: Refactor to launch test_datetime little bit faster > >> > >> - Added enabled_filed_count to avoid loop in > >> _elm_datetime_smart_sizing_eval(). > >> sizing_eval is called many times but field_count is only changed > >> when called > >> _reload_format(). > >> - Moved redundant if statement out of the loop in > >> _field_list_display(). > >> - Removed redundant call from _elm_datetime_smart_add(). > >> _field_list_arrange() is called in _reload_format(). > >> --- > >> src/lib/elm_datetime.c | 29 ++++++++++++++--------------- > >> src/lib/elm_widget_datetime.h | 1 + > >> 2 files changed, 15 insertions(+), 15 deletions(-) > >> > >> diff --git a/src/lib/elm_datetime.c b/src/lib/elm_datetime.c > >> index bb5ede9..5553b30 100644 > >> --- a/src/lib/elm_datetime.c > >> +++ b/src/lib/elm_datetime.c > >> @@ -103,14 +103,13 @@ _field_list_display(Evas_Object *obj) > >> > >> ELM_DATETIME_DATA_GET(obj, sd); > >> > >> + if (!dt_mod || !dt_mod->field_value_display) return; > >> + > >> for (idx = 0; idx < ELM_DATETIME_TYPE_COUNT; idx++) > >> { > >> field = sd->field_list + idx; > >> if (field->fmt_exist && field->visible) > >> - { > >> - if ((dt_mod) && (dt_mod->field_value_display)) > >> - dt_mod->field_value_display(sd->mod_data, > >> field->item_obj); > >> - } > >> + dt_mod->field_value_display(sd->mod_data, field->item_obj); > >> } > >> } > >> > >> @@ -326,6 +325,7 @@ _reload_format(Evas_Object *obj) > >> _expand_format(dt_fmt); > >> > >> // reset all the fields to disable state > >> + sd->enabled_field_count = 0; > >> for (idx = 0; idx < ELM_DATETIME_TYPE_COUNT; idx++) > >> { > >> field = sd->field_list + idx; > >> @@ -336,6 +336,13 @@ _reload_format(Evas_Object *obj) > >> field_count = _parse_format(obj, dt_fmt); > >> free(dt_fmt); > >> > >> + for (idx = 0; idx < ELM_DATETIME_TYPE_COUNT; idx++) > >> + { > >> + field = sd->field_list + idx; > >> + if (field->fmt_exist && field->visible) > >> + sd->enabled_field_count++; > >> + } > >> + > >> // assign locations to disabled fields for uniform usage > >> for (idx = 0; idx < ELM_DATETIME_TYPE_COUNT; idx++) > >> { > >> @@ -495,20 +502,14 @@ _elm_datetime_smart_disable(Eo *obj, void *_pd, > >> va_list *list) > >> static void > >> _elm_datetime_smart_sizing_eval(Eo *obj, void *_pd, va_list *list > >> EINA_UNUSED) > >> { > >> - Datetime_Field *field; > >> Evas_Coord minw = -1, minh = -1; > >> - unsigned int idx, field_count = 0; > >> > >> Elm_Datetime_Smart_Data *sd = _pd; > >> ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); > >> > >> - for (idx = 0; idx < ELM_DATETIME_TYPE_COUNT; idx++) > >> - { > >> - field = sd->field_list + idx; > >> - if ((field->visible) && (field->fmt_exist)) field_count++; > >> - } > >> - if (field_count) > >> - elm_coords_finger_size_adjust(field_count, &minw, 1, &minh); > >> + if (sd->enabled_field_count) > >> + elm_coords_finger_size_adjust(sd->enabled_field_count, &minw, 1, > >> &minh); > >> + > >> edje_object_size_min_restricted_calc > >> (wd->resize_obj, &minw, &minh, minw, minh); > >> evas_object_size_hint_min_set(obj, minw, minh); > >> @@ -836,8 +837,6 @@ _elm_datetime_smart_add(Eo *obj, void *_pd, va_list > >> *list EINA_UNUSED) > >> _field_list_init(obj); > >> _reload_format(obj); > >> > >> - _field_list_arrange(obj); > >> - > >> elm_widget_can_focus_set(obj, EINA_TRUE); > >> > >> elm_layout_sizing_eval(obj); > >> diff --git a/src/lib/elm_widget_datetime.h > b/src/lib/elm_widget_datetime.h > >> index f49b790..58e25ff 100644 > >> --- a/src/lib/elm_widget_datetime.h > >> +++ b/src/lib/elm_widget_datetime.h > >> @@ -61,6 +61,7 @@ struct _Elm_Datetime_Smart_Data > >> Elm_Datetime_Module_Data *mod_data; > >> char format[ELM_DATETIME_MAX_FORMAT_LEN]; > >> Evas_Object *access_obj; > >> + int enabled_field_count; > >> Eina_Bool user_format : 1; /* whether user set > >> * format or default > >> * format. */ > >> > >> -- > >> > >> > >> > > > > ------------------------------------------------------------------------------ > Managing the Performance of Cloud-Based Applications > Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. > Read the Whitepaper. > > http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk > _______________________________________________ > enlightenment-devel mailing list > enlightenment-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > ------------------------------------------------------------------------------ Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel