Opened 16 years ago
Closed 15 years ago
#2414 closed task (fixed)
Evaluate Optimization hint
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | 7.0 |
Component: | Book | Version: | SVN |
Severity: | normal | Keywords: | |
Cc: |
Description
Chapter 6 - Introduction mentions the "Optimization" hint which was last updated in 2003. We need to evaluate to see if it's still relevant.
Attachments (1)
Change History (6)
comment:1 by , 16 years ago
Milestone: | → 7.0 |
---|
by , 16 years ago
Attachment: | optimization.patch added |
---|
comment:2 by , 15 years ago
I took a look at this hint with the patch and think a few things are left out.
First, it does not mention that if you set CFLAGS or CXXFLAGS, it may override some other optimizations that the original package developer pot it. For example, looking at the parted package, the developer has:
CFLAGS = -g -O2 -Werror
If you override this, you will lose the -Werror option. This isn't too bad, but you may also lose some needed options in some packages like -fPIC or other code generation options.
The hint should strongly recommend setting the CFLAGS and CXXFLAGS for individual packages and *not* leave then set generically.
Second, since LFS now supports a 'pure 64-bit' build, the hint does not mention some important architectures that are directly supported such as core2 or i686.
Overall, the issue of optimization is very complex. It is far more complex than this short hint implies. I think as it stands now, the hint will get more users into trouble than it will help.
comment:3 by , 15 years ago
Also note that GCC, in general, usually produces better/faster code in each release (although it usually takes longer to do so due to going through more passes). In addition, the default passes that are run under -O2 & -O3 will change from release to release which may render particular recommendations out of date quite frequently. I'm leaning towards us removing mention of this hint in the book.
comment:4 by , 15 years ago
If you do remove it, note that it is referenced in two places in Chapter 6: Introduction and About Debugging.
comment:5 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Deleted the reference to the optimization hint at r9067.
Candicate patch to the hint itself to update a couple of things.