Why does my stand-alone created using the MATLAB Compiler take longer to start the first time?
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 2 Déc 2009
Modifié(e) : MathWorks Support Team
le 18 Juil 2024 à 8:11
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.
Réponse acceptée
MathWorks Support Team
le 18 Juil 2024 à 0:00
Modifié(e) : MathWorks Support Team
le 18 Juil 2024 à 8:11
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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Manage Products dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!