PATCH - HOME URL and profiles

Alexander Neundorf neundorf at kde.org
Sun Sep 19 22:17:03 BST 2004


On Sunday 19 September 2004 16:13, Dawit A. wrote:
...
> Well the problem with the approach you suggest is that it can easily get
> too complicated since we have protocols other than http/https that can be
> considered web based, e.g. ftp, webdav. So where does one draw the line ?
> And how can we prevent hard coding of such information so that the code
> does not need to be modified everytime a new protocol is added ?

Ok, it was just an idea :-)

> > Now a comment to the implementation: is it necessary to reload the
> > profile file everytime in slotHome() (searching the file, loading the
> > file and parsing it) ?  It would be better to do this only when loading
> > the profile I think.
>
> It would be better to do what you suggest if this was a critical path. But
> how many times does one press the Home button ? If not all the time, then
> why store the Home URL in memory ? My patch is not the only one that does
> this btw. In fact I based the code that reads from the config file on the
> function that creates a new window when a user requests one. Anyways, I am
> also too lazy to check the many paths that might be invoved in switching
> profiles and ensure a proper Home URL is loaded when that profile gets
> activated. :)

Well, it's no critical path. Nevertheless, getting the profile string from a 
variable in main memory takes on an idle low end box (e.g. K6/200 128 MB) 
probably less then 10 microseconds. Via the file it takes approx. 10 
milliseconds (from earlier measurements of KDE config file loading). This is 
approx. 1000 times more. It involves file i/o, several malloc()s and a load 
of string comparisons. 
Now if this box is not idle but busy (e.g. compiling KDE ;-), then the fast 
option will still only take < 1 ms, while the slow option (file i/o, 
malloc(),...) will probably take much much more then 10 ms, and suddenly an 
function which was fast even under load has become slow under load :-/

Bye
Alex
-- 
Work: alexander.neundorf at jenoptik.com - http://www.jenoptik-los.de
Home: neundorf at kde.org                - http://www.kde.org
      alex at neundorf.net               - http://www.neundorf.net




More information about the kfm-devel mailing list