development:performance
Table of Contents
Performance with C++
IEEE-754 Float Numbers
as written in Numeric / Math / Linear Algebra, calculation with denormals or non-numbers slows down performance - even when not signalled.
it might be interesting to abort a calculation, e.g. a matrix/vector multiplication, with first occurence of NaN - or with one of the other conditions ..
Optimization Remarks from Compiler
Ofek Shilon held the talk Optimization Remarks - Helping the Compiler to Generate Better Code at CppCon 2022. Here his PDF slides. Here also slides of a sligthly older talk on the same topic: https://www.slideshare.net/ofekshilon/optview2-c-on-sea-2022
references from his slides:
- llvm-opt-report
- debian package
llvm-14-tools
- clang compiler switch
-fsave-optimization-record
- opt-viewer / optview2
- https://github.com/OfekShilon/optview2 produces much better output
opt-viewer.py –output-dir <htmls folder> –source-dir <repo> <yamls folder>
- Clobbered by store
- use compiler specific keyword
__restrict
orHEDLEY_RESTRICT
- Clobbered by call or load
- function attribute
__attribute__((const))
orHEDLEY_CONST
const
functions are not using any saved/global state; thus free of side-effects- compiler can remove repeated invokations
const
is stronger thanpure
- function attribute
__attribute__((pure))
orHEDLEY_PURE
- hedley doc is much easier to understand / discriminate:
- function parameter attribute
__attribute__((noescape))
orHEDLEY_NO_ESCAPE
- Talk Compiler-assisted performance analysis of Adam Nemet
Sites, Blogs and Books
- Denis Bakhalov - EasyPerf!
- Johnny’s Software Lab
development/performance.txt · Last modified: 2023/01/22 by hayati