eina file - stat generation inexactness support
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Sun, 28 Jul 2019 10:51:15 +0000 (11:51 +0100)
committerWooHyun Jung <wh0705.jung@samsung.com>
Mon, 5 Aug 2019 01:48:29 +0000 (10:48 +0900)
commitd485ff45a72e23cbce01880d9fbf076cab7061f9
tree5d3fbbde2de1b4d206df96780bf8a64334b22372
parent71aabc14df7d8a4a4de3e2ae25ce628d8b99b18c
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.
src/lib/ecore/ecore_main.c
src/lib/eina/eina_file.c
src/lib/eina/eina_file.h
src/lib/eina/eina_file_common.c
src/lib/eina/eina_file_common.h