PDF4PRO ⚡AMP

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

Example: biology

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.

2. Code for correctness first, then optimize! • This does not mean write a fully functional ray tracer for 8 weeks, then optimize for 8 weeks! • Perform optimizations on your ray tracer in multiple steps. • Write for correctness, then if you know the function will be called frequently, perform obvious optimiza-tions.

Loading..

Tags:

  Your, Optimize

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