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

List:       kde-core-devel
Subject:    Re: CPU vs. disk caching (and it's effects on styles)
From:       Andreas Pour <pour () mieterra ! com>
Date:       2000-10-20 8:48:27
[Download RAW message or body]

mosfet wrote:
> 
> Okay, I'm getting all the new style stuff ready and I have an
> interesting question on my mind.
> 
> Most of the widgets in the new widget styles use pixmaps and gradients
> that can use custom colors. For example, the highcolor style can use
> gradients whose colors are user configurable for most of the widgets.
> 
> Right now I'm calculating gradients when the application is constructed.
> 
> Thing is, with new color scheme changes there can be a quite a few
> gradients to calculate. With fast CPU's, what is faster - calculating
> the gradients at app startup or caching them on disk and loading them?
> My initial feeling is that calculating them at startup would be faster
> than loading a cached version from disk, because our KDE effects are
> very fast, but I am not sure because of disk caching, etc...
> 
> Any suggestions on this? Should I be caching things on disk or just
> calculating pixmaps dynamically? I'm not sure myself...

Hi,

I would think that is very hard to tell w/out testing -- depends on file
size, when you load the cache (sounds like it would be happening at KDE
startup, where probably most things are I/O bound rather than CPU bound)
and how much processing is involved.

Probably the best bet is to write two functions, one using either
method, and time calling each one 10000 times or so.  If there is no
significant advantage to the file caching method I would go with the
just-in-time method, as in real scenarios you will take a hit for
reading off the disk the first time.

Hope that's useful,

Andreas Pour

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

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