Quadrupling code performance with a "useless" if
4 hours ago
- #branch prediction
- #compression optimization
- #instruction-level parallelism
- Describes optimizing a domain-specific compressor by improving a critical path loop.
- Highlights the issue of dependency chains preventing instruction-level parallelism.
- Proposes using branch prediction to predict stable values and break dependency chains.
- Suggests a volatile cast trick to prevent compiler optimizations that would remove the branch.
- Mentions potential alternative data structure improvements but notes trade-offs.