summaryrefslogtreecommitdiff
path: root/src/lib/efreet/efreet_private.h
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-08-23 11:59:37 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-08-23 12:04:06 +0900
commit561f8eaa8faebe32b9a03cf9674c147cf0d6d9ab (patch)
tree150e42dcb87333b146e884f6bf72dc5f561e7967 /src/lib/efreet/efreet_private.h
parent56c52311e5590543272b0465a750936475ad28e7 (diff)
efreet - save about 240-300k or so of memory used by efreet mime
so efreet mime was loading a bunch of mime type info files, parsing them on startup and allocating memory to store all this mime info - globs, mimetype strings and more. all a big waste of memory as its allocated on the heap per process where its the SAME data files loaded every time. so make an efreet mime cache file and a tool to create it from mime files. mmap this file with all the hashes/strings in it so all that data is mmaped once in memory and shared between all processes and it is only paged in on demand - as actually read/needed so if your process doesnt need to know about mime stuff.. it wont touch it anyway. this saves about 240-300k or so of memory in my tests. this has not covered the mime MAGIC files which still consume memory and are on the heap. this is more complex so it will take more time to come up with a nice file format for the data that is nicely mmaped etc. @optimize
Diffstat (limited to '')
-rw-r--r--src/lib/efreet/efreet_private.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/efreet/efreet_private.h b/src/lib/efreet/efreet_private.h
index 139754d81a..47d6deae12 100644
--- a/src/lib/efreet/efreet_private.h
+++ b/src/lib/efreet/efreet_private.h
@@ -251,6 +251,8 @@ EAPI void efreet_fsetowner(int fd);
251 251
252EAPI extern int efreet_cache_update; 252EAPI extern int efreet_cache_update;
253 253
254EAPI extern void (*_efreet_mime_update_func) (void);
255
254#undef EAPI 256#undef EAPI
255#define EAPI 257#define EAPI
256 258