summaryrefslogtreecommitdiff
path: root/src/lib/ecore
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-07-28 11:51:15 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-07-28 11:51:15 +0100
commit9b294d6284fbda62dde20bcb31732a1c63a65962 (patch)
tree0ca334db76e922ae119ad554464bb9200f256694 /src/lib/ecore
parent0ff42fa4e51d5aa94b6d60e300a77876b82fe952 (diff)
eina file - stat generation inexactness support
this is a performance optimization. it brings in a "stat generation". for now it's disabled by default so we retain previous behavior. this stops eina file from opening and stating a file every time you open ... it only does it if stat generation is off, or, if the generation changed since the last time it opened that file. this makes cache hits not have a 3 syscall cost (open+fstat+close). this optimizes that lower end of things path. but .. it comes at a cost. if the file changes before generation ticks over (which this forces to tick over every time the loop exits idle by default). now here is something to ask. 1. should we have this on by default and accept the "inexactness" since you can eina_file_statgen_next() before any call that would do i/o to force it to look at the real file stat info... 2. should we tick over every idle enter OR every N idle enters or every frame we render instead? ... i want to avoid getting a timestamp or having a timer interrupt often... so what should we do? at least this introduces the idea, some api's and an env var to turn this on. it definitely cuts down syscalls during things like creation of widdgets or objects in large batches etc.
Diffstat (limited to 'src/lib/ecore')
-rw-r--r--src/lib/ecore/ecore_main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c
index f7d248fc27..e898b6e0f3 100644
--- a/src/lib/ecore/ecore_main.c
+++ b/src/lib/ecore/ecore_main.c
@@ -331,6 +331,7 @@ _ecore_main_uv_poll_cb(uv_poll_t *handle, int status, int events)
331 { 331 {
332 DBG("not IDLE anymore"); 332 DBG("not IDLE anymore");
333 _ecore_main_uv_idling = EINA_FALSE; 333 _ecore_main_uv_idling = EINA_FALSE;
334 eina_file_statgen_next();
334 efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL); 335 efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL);
335 _ecore_animator_run_reset(); 336 _ecore_animator_run_reset();
336 } 337 }
@@ -794,6 +795,7 @@ _ecore_main_gsource_dispatch(GSource *source EINA_UNUSED,
794 if (ecore_idling && events_ready) 795 if (ecore_idling && events_ready)
795 { 796 {
796 _ecore_animator_run_reset(); 797 _ecore_animator_run_reset();
798 eina_file_statgen_next();
797 efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL); 799 efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL);
798 ecore_idling = 0; 800 ecore_idling = 0;
799 } 801 }
@@ -808,6 +810,7 @@ _ecore_main_gsource_dispatch(GSource *source EINA_UNUSED,
808 if (ecore_fds_ready || events_ready || timers_ready) 810 if (ecore_fds_ready || events_ready || timers_ready)
809 { 811 {
810 _ecore_animator_run_reset(); 812 _ecore_animator_run_reset();
813 eina_file_statgen_next();
811 efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL); 814 efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL);
812 ecore_idling = 0; 815 ecore_idling = 0;
813 } 816 }
@@ -867,6 +870,7 @@ _ecore_main_loop_timer_run(uv_timer_t *timer EINA_UNUSED)
867 if (_ecore_main_uv_idling) 870 if (_ecore_main_uv_idling)
868 { 871 {
869 _ecore_main_uv_idling = EINA_FALSE; 872 _ecore_main_uv_idling = EINA_FALSE;
873 eina_file_statgen_next();
870 efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL); 874 efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL);
871 _ecore_animator_run_reset(); 875 _ecore_animator_run_reset();
872 } 876 }
@@ -2243,6 +2247,7 @@ _ecore_main_loop_uv_prepare(uv_prepare_t *handle EINA_UNUSED)
2243 2247
2244 if (_ecore_main_uv_idling) 2248 if (_ecore_main_uv_idling)
2245 { 2249 {
2250 eina_file_statgen_next();
2246 efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL); 2251 efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL);
2247 _ecore_animator_run_reset(); 2252 _ecore_animator_run_reset();
2248 _ecore_main_uv_idling = EINA_FALSE; 2253 _ecore_main_uv_idling = EINA_FALSE;
@@ -2473,6 +2478,7 @@ process_all: //-*********************************************************
2473 if (!once_only) 2478 if (!once_only)
2474 { 2479 {
2475 _ecore_animator_run_reset(); // XXX: 2480 _ecore_animator_run_reset(); // XXX:
2481 eina_file_statgen_next();
2476 efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL); 2482 efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL);
2477 } 2483 }
2478 // call the fd handler per fd that became alive... 2484 // call the fd handler per fd that became alive...