LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Arch (https://www.linuxquestions.org/questions/arch-29/)
-   -   Makepkg CFLAGS and performance (https://www.linuxquestions.org/questions/arch-29/makepkg-cflags-and-performance-845483/)

TheStarLion 11-20-2010 04:52 AM

Makepkg CFLAGS and performance
 
With a little help from the ArchWiki page on makepkg.conf and a few Gentoo Wiki pages it linked to, I've found that recompiling certain packages with '-march=k8-sse3 -mtune=k8' (what '-march=native' gives me) has resulted in some things being more responsive or snappier.

So far I've seen noticible improvements in Firefox and to a lesser degree Wine.

It was suggested on the main IRC channel for Arch that recompiling the entire system using these CFLAGS in place of the default '-march=i686 -mtune=generic' might help, but was probably a bad idea or not really worth it.

So what I'm interested in is what packages might be worth recompiling with the new CFLAGS, or what ones might show some improvement with them instead.

I could also, in theory, move to x86_64, as the processor supports it. With less than 4GB of RAM on the system though, is it really worth it?

rjlee 11-20-2010 06:28 AM

If you want the maximum performance boost for the least amount of recompiling, then recompile the kernel and/or libc; these are used my most programs across the board and so should make the most noticeable difference.

Quote:

Originally Posted by TheStarLion (Post 4165217)
I could also, in theory, move to x86_64, as the processor supports it. With less than 4GB of RAM on the system though, is it really worth it?

It depends on what you're doing, but it's generally still not a good idea to use 64-bit executables on systems with less that 4GB of RAM, unless you're doing something that would significantly benefit from a specific 64-bit extension, or run mathematical programs that use a lot of 64-bit variables (astronomical simulations spring to mind).

The problem is that your data variables get aligned on 8-byte (64-bit) boundaries instead of 4-byte, resulting in a lot of wasted memory space between variables. In turn, this means you're using memory less efficiently, and have less memory to use as a cache space, resulting in more direct disk I/O. This tends to wipe out any performance gain you get just from moving larger numbers around. Because you have less free memory, you may even find your system swapping more quickly, which very quickly causes performance problems. So I'd stick to 32-bit if I were you.

Hope that helps,

—Robert J Lee

TheStarLion 11-20-2010 06:30 AM

Useful information, thanks.
At about what point after 4GB of RAM do the benefits start to out-weigh those issues?


All times are GMT -5. The time now is 04:06 AM.