Speed sensation

Roger Larsson roger.larsson at norran.net
Wed Apr 23 08:34:18 CEST 2003


On tisdag 22 april 2003 12:02, Waldo Bastian wrote:
> On Tuesday 22 April 2003 08:21, Roger Larsson wrote:
> > What to do?
> > * Don't demand page text (code) on computers with enough memory.
> >   [See message from Andrew Morton below]
> > * Use less configuration files, i.e a registry :-(
> >   - A registry is a single point of failure.
> >   - Hard to edit and search with ordinary tools.
> >   + Fewer disc accesses, as long as it is continous on disk...
> >
> >   Well I do not like that but a persistent configuration file cache...
> >   (but it is costly to check that the cache is consistent...)
> >   Or gzip:ing all configuration files in .kde to one .gz
> 
> It's called ksycoca :-)

http://developer.kde.org/documentation/library/kdeqt/kde3arch/ksycoca.html
"Application specific configuration information will _NOT_ be stored in Sycoca 
since this information is usually subject to regular change. "

> 
> Ensuring that it is consistent is unfortunately one of the more time 
consuming 
> operations during startup. Especially if the cache needs to be rebuild.

How does it detect that the cache needds to be rebuilt?
1) Happily load the data and assume that it is OK.
2) kded checks all file dates and adds dnotify for future changes.
Could the kded scan be postponed until kde waits for user interaction?

BTW,
I have tested a patch that adds madvise(,,MADV_WILLNEED) to
ksycoca, but it makes no measurable difference.

--- ksycoca.cpp 31 Mar 2003 14:49:03 -0000      1.79
+++ ksycoca.cpp 22 Apr 2003 23:37:30 -0000
@@ -125,6 +125,11 @@ bool KSycoca::openDatabase( bool openDum
      m_sycoca_mmap = (const char *) mmap(0, m_sycoca_size,
                                 PROT_READ, MAP_SHARED,
                                 database->handle(), 0);
+     if (madvise(m_sycoca_mmap, m_sycoca_size, MADV_WILLNEED))
+       {
+        perror("madvice");
+       }
+

/RogerL

-- 
Roger Larsson
Skellefteå
Sweden






More information about the Kde-optimize mailing list