Page MenuHomePhabricator

Efl.Ui.Radio_Legacy: Prevent unnecessary signal emit for contents
ClosedPublic

Authored by jsuya on May 11 2020, 10:36 PM.

Details

Summary

When call elm_radio_add, theme_apply of layout is called and
_efl_ui_radio_legacy_efl_ui_widget_theme_apply is called.
Then it calls the signal emit for the icon.
this call is unnecessary.

Test Plan

Evas_Object *bt;
clock_t start, finish;
double sum= 0 ;
double avg = 0;
double cnt = 1000;

for(int i =0 ; i<(int)cnt; i++)

{
   start = clock();
   bt = elm_radio_add(win);
   finish = clock();
   sum += (double)(finish-start)/CLOCKS_PER_SEC;
}

avg = sum / cnt ;
printf("radio avg : %f\n",avg);

[before]
radio avg : 0.000232

[after]
radio avg : 0.000197

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
jsuya created this revision.May 11 2020, 10:36 PM
jsuya requested review of this revision.May 11 2020, 10:36 PM
jsuya updated this revision to Diff 30225.May 12 2020, 5:53 AM

Update code - use efl_finalized_get

jsuya updated this revision to Diff 30226.May 12 2020, 5:54 AM
jsuya edited the test plan for this revision. (Show Details)

update test results

Can you elaborate why the icon signal is unnessesary ? If no icon is set, the theme will not receive the hidden signal, which was sent before ...

zmike added a comment.May 12 2020, 7:45 AM

The premise here is that the default state of the theme should match the default state of the widget, and thus there's no need to ever send signals here before finalize because they can never be anything but the default. This is only ever not the case with the unified API, when it's possible to change properties during construction.

Okay yeah, makes sense.

zmike accepted this revision.May 12 2020, 8:19 AM
This revision is now accepted and ready to land.May 12 2020, 8:19 AM
This revision was automatically updated to reflect the committed changes.