Why does my standalone created using the MATLAB Compiler take longer to start the first time?
9 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2009-12-2
编辑: MathWorks Support Team
2024-7-31
It takes longer to start my standalone application the first time it runs than consecutive runs. Also if I run the application some time later, it again takes longer the first time but becomes faster on consecutive runs. I would expect it to always start quicker after the first run.
采纳的回答
MathWorks Support Team
2024-7-31
编辑:MathWorks Support Team
2024-7-29
The time improvement is expected behavior and is an optimization done by the operating system. This behavior is typical of all programs. When a program starts, it needs to be loaded from a slow medium (hard disk), to a fast medium (RAM). When a program stops running, the code for the program is not removed immediately; instead it is removed when a page fault occurs:
Page fault
See also:
Locality of reference
Since a machine does not have infinite memory, the code in memory is removed once another program needs it. If you restart your compiled application immediately, the code is already in memory and does not need to be reloaded from disk, so it's fast. If it has already been removed from memory, then in needs to be reloaded from the disk.
This is all normal operating system behavior. For more detailed information, refer to literature regarding operating systems.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Manage Products 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!