Advanced QML Topics
This section covers advanced topics for optimizing and fine-tuning QML applications.
Caching and Performance
The QML Disk Cache
The QML disk cache stores compiled QML and JavaScript code on disk to improve application startup time. When a QML document is loaded for the first time, it's compiled to bytecode and cached in a platform-specific location. Subsequent loads of the same document can use the cached bytecode instead of recompiling from source, significantly reducing initialization overhead.
JavaScript Engine Configuration
Configuring the JavaScript Engine
The JavaScript engine can be configured with various environment variables to control compilation behavior, garbage collection settings, and runtime optimizations. These settings allow you to tune the JavaScript engine for specific use cases, such as favoring startup time over peak performance or adjusting memory usage patterns.
Memory Management in the JavaScript Engine
The JavaScript engine uses garbage collection to automatically reclaim memory from objects that are no longer in use. Understanding how the garbage collector works, including generational collection strategies and heap organization, helps you write QML and JavaScript code that performs efficiently and avoids common memory-related performance pitfalls.
See also QML Profiler and JavaScript Host Environment.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.