Page MenuHomePhabricator

eo: make callback_add faster
Needs ReviewPublic

Authored by bu5hm4n on Jul 31 2020, 1:57 AM.



I was researching for quite some time how eo events could be made
faster, while doing that i recognized that we are not utilizing the full
size of Efl_Object_Data, so we can do a little bit more hinting for how
our events are currently working.

In this commit a flag called single priority is inserted. This flag
ensures that the object only has one callback priority registered, which
gives us the possibility of skipping the binary search, the search
itself is not that bad, however, alone the loading of the instructions
takes time, so this way we can skip the search, *and* the instructions
for moving the array elements to later.

Diff Detail

rEFL core/efl
Lint OK
No Unit Test Coverage
Build Status
Buildable 17225
bu5hm4n created this revision.Jul 31 2020, 1:57 AM
bu5hm4n requested review of this revision.Jul 31 2020, 1:57 AM

Your benchmark seems to indicate that the new version result in more work and just the CPU clock got run at higher frequency which made it faster. Could you do your benchmark by running your CPU at full fixed speed just to be sure?

Mhm :( yeah, now the times are not great anymore ... :|

       471.34 msec task-clock:u              #    0.964 CPUs utilized
            0      context-switches:u        #    0.000 K/sec
            0      cpu-migrations:u          #    0.000 K/sec
        7,327      page-faults:u             #    0.016 M/sec
1,513,816,860      cycles:u                  #    3.212 GHz
2,246,871,347      instructions:u            #    1.48  insn per cycle
  375,434,454      branches:u                #  796.526 M/sec
    4,104,794      branch-misses:u           #    1.09% of all branches

  0.489077657 seconds time elapsed

  0.437945000 seconds user
  0.033104000 seconds sys


       457.52 msec task-clock:u              #    0.986 CPUs utilized
            0      context-switches:u        #    0.000 K/sec
            0      cpu-migrations:u          #    0.000 K/sec
        7,318      page-faults:u             #    0.016 M/sec
1,519,498,088      cycles:u                  #    3.321 GHz
2,215,082,068      instructions:u            #    1.46  insn per cycle
  370,292,681      branches:u                #  809.351 M/sec
    4,066,289      branch-misses:u           #    1.10% of all branches

  0.464178714 seconds time elapsed

  0.433932000 seconds user
  0.023094000 seconds sys

its still an improvement ... Just not that great anymore.

bu5hm4n updated this revision to Diff 31001.Aug 5 2020, 2:04 AM
bu5hm4n retitled this revision from WIP eo: make callback_add faster to eo: make callback_add faster.
bu5hm4n edited the summary of this revision. (Show Details)

rebase & commit message update