Optimization Tips - Mo' Hustle Mo' Problems
summary
Slides and hhvm source show concrete wins and losses: changing GCC flags flips a 5% regression in GCC 4.8 to a 2% win; inlining one implicitly generated destructor yields CP instructions −0.3% / CPU time +0.4% because of instruction-cache pressure; defanging never_inline gives +0.9% instructions / +1.6% CPU time while defanging always_inline gives −0.2% instructions / +0.8% CPU time. Practical builds: lazy refcount allocation, skip-last-decrement, colocated counters or saturated small counters, and separating allocator metadata reduce icache and write-amplification in large apps.
AI-written summary · about
chapters (20)
- 0:00Intro
- 0:53Optimization
- 2:16Inlining
- 5:06Constructors
- 9:35Cache
- 12:11Inline Destructors
- 18:27Always in Line
- 24:48Atomic Reference
- 28:22Atomic Weapons
- 33:04preparatory comments
- 34:17lazy reference count allocation
- 37:15alternative
- 38:12performance dynamics
- 39:57hotter functions
- 42:38zero is special
- 46:04Conclusion
- 46:58Keeping the last decrement
- 50:57Using dedicated allocators
- 52:30Smaller counters
- 53:17Summary
related talks
01h 02mMaking the Most Out of Your Compiler
01h 37mAn Overview of Program Optimization Techniques
55mCode Size Compiler Optimizations and Techniques for Embedded Systems
01h 06mPerformance engineering: being friendly to your hardware
01h 05mPerformance Optimization in Software Development - Being Friendly to Your Hardware
42mPractical Optimizations
01h 00mMoving Faster: Everyday efficiency in modern C++
37mC++ as an Optimizing Assembler - a Performance Talk
