Why does my stand-alone created using the MATLAB Compiler take longer to start the first time?

10 次查看(过去 30 天)
It takes longer to start my stand-alone application the first time it is run 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
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 个)

类别

Help CenterFile Exchange 中查找有关 Manage Products 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by