» Sign in
  
Jump to HP Home Jump to Product & Services Jump to Support & Drivers Jump to Solutions Jump to How to buy
» Contact HP
 » Advanced Search
Jump to HP Home

Performance checklist for software development on Integrity servers

Developer & Solution Partner Program (DSPP)


A site for HP Partners

 »  DSPP home

Benefits & Services
 »  Marketing & Sales
 »  Technical
 »  Collaboration

Resources & Downloads
 »  Technologies & Tools
 »  HP Products
 »  HP Solutions
 »  Software downloads

 »  Specialized programs

 »  Events
 »  Newsletters

Partner information
 »  Find a partner
 »  Find a partner solution

Shortcuts for
 »  Independent software vendors
 »  Integrators & Consultants

About DSPP
 »  Why join?
 »  Membership benefits

 »  Latest updates

 »  Contact us

 »  Site map

Compilers for Itanium-based servers are designed to optimize code for the Itanium-based architecture. They do this with features that encourage:
» Instruction pipelining
» Minimize ambiguities (program analysis)
» Prevent data bloat (managing memory resources)
» Use faster constructions (branch handling and prediction)
» Improve locality (speculation)

You can help the compiler and increase your executable's performance by using some of the suggestions in this checklist. For a more detailed explanation of code optimizing, refer to the STK reference documents.

Instruction pipelining

[  ]never hand-optimize by such practices as loop unrolling; the compiler can do a better job
[  ]use pretest instead of posttest loops (while/do or for instead of do/until)
[  ]keep loops as simple as possible
[  ]avoid loop-carried dependencies (don't use variables returned from previous executions of a loop)

Minimize ambiguities (program analysis)

variables
[  ]use static local variables instead of global variables when possible
[  ]mark variables static that are global within a file
[  ]don't assign function or variable addresses to global variables
[  ]don't use global variables as loop counters
[  ]don't reuse the same variable for unrelated computations
[  ]mark variables as const whenever possible
[  ]avoid taking the address of a variable because address sizes vary between platforms
pointers
[  ]minimize the use of pointers
[  ]avoid having multiple pointers to one data area
[  ]avoid accessing a variable both directly and via a pointer
[  ]use array-based addresses instead of pointers: v[i++] rather than *v++
[  ]don't pass a pointer parameter into a function and then assign a global variable to it
[  ]point to the beginning of structures, rather than the middle
functions
[  ]mark functions static if possible
[  ]use restrict when a function's parameters cannot point to the same variable

Prevent data bloat (managing memory resources)

[  ]don't compile your software for 64-bit unless you really need 64-bit
[  ]use the correct data types for the job, for example, don't use a long when an int works
[  ]sort structures by size: 64-bit items together, pointers together, shorts together, etc.

Use faster constructions (branch handling and prediction)

[  ]put the usually taken branches first in if or case statements
[  ]avoid data dependencies (use array indexing instead of pointers)
[  ]make if conditions complex using || or && rather than nesting if statements
[  ]use a switch statement rather than nested ifs
[  ]use inline on small frequently executed functions
[  ]post-increment induction variables rather than pre-incrementing: i++ not ++i
[  ]use integers for array indices rather than unsigned integers

Improve locality (speculation)

[  ]minimize branching and procedure calls
[  ]locate sets of functions that call each other frequently in the same file, preferably in the usual order called
[  ]place functions into fewer and larger files to maximize file optimization
[  ]sort structures for speed by putting things used together in close proximity








Printable version

Privacy statement Using this site means you accept its terms Trademark acknowledgment Contact us
HP Confidential © 2009 Hewlett-Packard Development Company, L.P.