Real-life optimization work
Posted Nov 2, 2005 23:31 UTC (Wed) by stef70
In reply to: Real-life optimization work
Parent article: All hail the speed demons (O'Reillynet)
Apart from the fact that in the 'good old time', application had far less features, I also believe that they were not as fast as we usually remember.
For example, my first experience on UNIX was on some SUN X stations with a 486 processors. I was really impressed by the speed of those 'beast' and by they graphic capabilities. Everything was fast on those machines.
I was upgraded to a newer SUN using a sparc processor.
After a few year, I had to work again on the 486.
The configuration (hardware+software) was exactly the same as before but everything was slow. I could clearly see the window redrawing themselves.
That obviously did not bother me a few years back.
About the clock applet: you should not trust an memory usage reported by the Linux kernel. In a desktop environment like Gnome, most of the memory is shared between applications and libraries. A more accurate way to evalute the memory footprint of the clock applet is to substract its SHARED memory from its RESIDENT memory. On my system (amd64) that gives 1.6MB.
Even 1.6MB is quite a lot for a simple clock.
A quick look in the memory map shows that about half of it is used by the clock applet itself (HEAP+STACK). The rest is used by the non-readonly segments (and so non-shared) of the shared libraries.
I think that the problem is the large number of shared library liked with each Gnome applications.
My clock applet is using 84 shared library.
Each shared lib requires at least one page (4KB) of non-shared memory for its non-constant global data. That's a minimum of 4K * 84 = 336K.
In practice, you should at least double or triple that number since some libraries use more that 4KB of non-constant global data.
The sad part is that most of the libraries are probably never used by the clock applet so that memory is allocated for nothing.
For example, does the clock really need an XML parser? libxml2 and libexpat are using 36KB+12KB of non shared memory.
And what to think of libgpg, libcrypt & libk5crypto in a clock applet?
to post comments)