[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Newbie: Cache disk before reads
From:       Karim Ryde <karim () bredband ! net>
Date:       2005-07-01 14:19:43
Message-ID: 200507011619.44528.karim () bredband ! net
[Download RAW message or body]

Kool :-) 
I'll check it out!

The size of the directories to scan seems not to be a issue?
The app I'm working will parse specific text files (maybe 20000) in 140 
directories and a total size of 200MB.

Maybe KIO has a recursive find...

/Karim

On Friday 01 July 2005 15.29, Nathan Toone wrote:
> In order to speed up KDE, you can preload your information.  There is a web
> page at http://wiki.kde.org/tiki-index.php?page=Performance+Tips#id139336
> about directory prescanning.
>
> In this article, it talks about how you can prescan your KDE directories
> while KDM is waiting for you to enter in your password.  This is very
> useful if you use KDM, which I don't.
>
> I also didn't want to slow down my computer in the name of speeding it up. 
> So my solution was to do the preloading while my computer is waiting to get
> its DHCP address.  Since this process (getting an IP address) is mainly
> network intensive (and doesn't use the disk much), I do the following:
>
> Before getting my IP address, (in an init script) I start doing my preload
> with the following command:
>
>     if [ -n "${preload}" ]; then
>         find ${preload} >/dev/null 2>&1 &
>         preloadpid=$!
>     fi
>
> The variable ${preload} is defined as follows:
> preload="/home/ntoone/.kde /usr/kde/3.4/share/applications
> /usr/kde/3.4/share/applnk /usr/kde/3.4/share/mimelnk
> /usr/kde/3.4/share/services /usr/kde/3.4/share/servicetypes
> /usr/kde/3.4/share/config /usr/kde/3.4/share/icons /usr/share/applications
> /usr/share/lnk /usr/share/mimelnk /usr/share/services /usr/share/config
> /usr/kde/"
>
> Put your own home directory (instead of /home/ntoone) and your own KDE
> directory (instead of /usr/kde/3.4)  I found this is the optimal order -
> but you can play around with the order as well.
>
> After I get my IP address, I do the following:
>
>             if [ -n "${preload}" ]; then
>                 kill -9 $preloadpid >/dev/null 2>&1
>             fi
>
> because I don't want to keep preloading - you can kill it at any time and
> have the benefit of what you've done so far.
>
> Like I said - this works for me - I like it because on my laptop, when I'm
> connected to a network, DHCP comes back quickly, so I don't get to entirely
> preload KDE.  However, when I'm not connected, DHCP takes a while (5
> seconds or so) to timeout - and I get the entire thing preloaded - so KDE
> starts faster (making up for the lost time waiting for a network addres...
> :) )
>
> I guess you can put these commands anywhere you would like - and you can
> mess around with the directories that you put in there as well.
>
> Hope this helps.
>
> -Nathan
>
> On Friday 01 July 2005 04:11 am, Karim Ryde wrote:
> > Hi!
> >
> > Since files are cached once read I wonder if they can be cached before.
> > I do know which directories I will parse.
> >
> > Thanx for any pointers...
> >
> > /Karim
> >
> > >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
> > >> unsubscribe <<
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic