PDF4PRO ⚡AMP

Modern search engine that looking for books and documents around the web

Example: quiz answers

Tips for Optimizing C/C++ Code - Clemson University

Tips for Optimizing C/C++ Ahmdal s Law:Speedup=timeoldtimenew=1(1 funccost)+funccost/funcspeedup Wheref unccostis the percentage of the program runtime used by the functionf unc, andf uncspeedupisthe factor by which you speedup the function. Thus, if you optimize the functionT riangleIntersect(), which is 40% of the runtime, so that it runstwice as fast, your program will run 25% faster (1(1 )+ ). This means infrequently used code ( , the scene loader) probably should be optimized little (if at all). This is often phrased as: make the common case fast and the rare case correct. for correctness first, then optimize! This does not mean write a fully functional ray tracer for 8 weeks, then optimize for 8 weeks!

• Double precision floating-point operations may not be slower than single precision floats, particularly on 64-bit machines. I have seen ray tracers runfaster using all doubles than all floats on the same machine. I have also seen the reverse. 27. Consider ways of rephrasing your math to eliminate expensive operations.

Loading..

Tags:

  Precision

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Spam in document Broken preview Other abuse

Transcription of Tips for Optimizing C/C++ Code - Clemson University

Related search queries