Solved Build with optimization for cpu, how much will it boost the performance

1. build libs with optimization for specific cpu, like C run time libraries ...
2. build kernel with optimization for specific cpu
3. build applications with optimization for specific cpu
How much will it boost the performance?
How much power energy will it save?
Thanks.
 
Performance? Just a recompile with the correct CPU flags? Most likely less than 10%. I"m assuming you are using a relatively common CPU, and in particular you are not using a 32-bit system on a 64-bit CPU.

Power? Assuming that your system is not completely CPU dominated (very few are, even well-tuned supercomputers and large cloud providers only get to 60-80% CPU utilization, most servers and desktops are in the 1-10% CPU utilization range), it will make very little difference. Why? Amdahl's law: Since the CPU is already very little utilized, your power consumption is probably dominated by other things: disk, networking (wireless), display, the fixed overhead of memory and CPU.

Now, if you are running a supercomputer center or a giant cloud farm that uses 20MW, then it might make sense. But you are more likely to have a net loss of energy usage and CPU consumption: You will use more to completely rebuild the system than you save over the lifetime.

By all means, do the experiment and measure, and report back. But if you have anything else useful to do, I would work on other things first. Just getting out of the chair and turning the hallway light off is probably a bigger saving.
 
Performance? Just a recompile with the correct CPU flags? Most likely less than 10%. I"m assuming you are using a relatively common CPU, and in particular you are not using a 32-bit system on a 64-bit CPU.

Power? Assuming that your system is not completely CPU dominated (very few are, even well-tuned supercomputers and large cloud providers only get to 60-80% CPU utilization, most servers and desktops are in the 1-10% CPU utilization range), it will make very little difference. Why? Amdahl's law: Since the CPU is already very little utilized, your power consumption is probably dominated by other things: disk, networking (wireless), display, the fixed overhead of memory and CPU.

Now, if you are running a supercomputer center or a giant cloud farm that uses 20MW, then it might make sense. But you are more likely to have a net loss of energy usage and CPU consumption: You will use more to completely rebuild the system than you save over the lifetime.

By all means, do the experiment and measure, and report back. But if you have anything else useful to do, I would work on other things first. Just getting out of the chair and turning the hallway light off is probably a bigger saving.

JIT compilers will query CPU features for compiling, but they are easier to be hacked when they are running on a public server. I think C++ should have a potential to beat the JIT compilers any way. I think the thought is a little simple, there are other things to consider, like: memory managerment, effort, ... I'm just curious about this, coz I'm working on somehting that needs some compiler knowledge, then recall the question. Maybe I'll do some comparisons later. Thanks.
 
Back
Top