Optimizing Qt Application
summary
Profile with tools like heaptrack, Valgrind and perf to find hidden heap allocations and cache misses; temporary QString conversions cause UTF‑8→UTF‑16 work and allocations unless you use QStringLiteral or QLatin1String; prefer QStringRef and QStringBuilder to avoid repeated copies; use QVector with movable types instead of QList to avoid per-item heap allocs; use non‑recursive QMutex (recursive is ~2x slower), QElapsedTimer (about 4x faster) or UTC time access (10–20x faster) and QDir::entryInfoList to avoid repeated stats (up to ~100x).
AI-written summary · about
chapters (19)
- 0:00Introduction to optimization
- 1:06Profiling and benchmarking
- 3:57Anti-patterns in Qt code
- 4:39Implicit Qstring conversions
- 6:03Temporary allocations in loops
- 7:04Compile-time error prevention
- 8:10Qstring builder for appending
- 8:52Avoiding Qstring mid allocations
- 10:18When to use Qstring
- 11:03Qvector vs Qlist allocations
- 12:49Returning containers by value
- 14:37Qmap with pointers misuse
- 15:19Hashing strings in Qhash
- 16:45Iterating Qassociative containers
- 17:12Recursive vs non-recursive mutex
- 18:15DateTime performance pitfalls
- 19:20Qdir entry info optimization
- 20:26Tools and further reading
- 21:16Q&A session
related talks
01h 00mMeasuring Qt Performance
01h 00mHow to optimise Qt Quick 2 applications for maximum performance
01h 02mCreating Performant Qt Quick Apps
01h 10mPerformance: Do Graphics the Right Way
52mAccelerating Qt WebKit Applications
58mC++ Performance and Optimisation
28mUsing Qt Quick with low end devices (eg i.MX6)
01h 00mMoving Faster: Everyday efficiency in modern C++
