Re: Menu being purged from memory? Was: New Control Centre



El mar, 06-02-2007 a las 01:37 +0000, Richard Hughes escribi�> Hmm. How do you stop the menus being purged? This is in reference to my
> blog about optimizing GNOME for speed for a large memory system [1].

Either I'm a total liar, or I can't find that code anymore.  Probably
both :)  I'd assume it was on gnome-panel/gnome-panel/menu.c.

Anyway... holding everything in memory will not fix things :)  You have
to actually investigate what is being slow in a program, and fix *that*.
You can't do optimization by brute force; it just doesn't work, because
you may be changing things which have little to no effect on the total
running time of operations.

Say you have an operation with two parts, A and B.  You have a hunch
that B is the culprit, so you make it twice as fast.  You take timings
and your program is not much faster.

However, if you had profiled things from the beginning, you would have
seen that part A takes 8 seconds and part B takes 2 seconds:

  AAAAAAAABB

When you made B twice as fast, by putting all of it in RAM:

  AAAAAAAAB

Now this takes 9 seconds.

Instead, if you had worked on making A twice as fast (say, by using a
better algorithm there)...

  AAAABB

you take 6 seconds, which is a lot better than the 9 seconds from
before!  I.e. you have to know *what* part to optimize.

Some thing indeed become better by "putting all of them in RAM", but you
have to *identify* those things first, and actually determine that it's
not having them in RAM that is the culprit.

  Federico




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]