Same script, faster execution when running in a spawned instance (“!matlab …”)?
Dear Community,
I am running Matlab 2024b under Windows 10 / 32GB RAM on a 6-core laptop Intel CPU (hyperthreading deactivated). For the sake of runtime optimisation I have done the following comparison:
case #1: a script running within the current Matlab session (single instance) and
case #2: the same script running in a spawned session (instance), using "!matlab -nosplash -desktop -r "load …" (etc.).
The runtime results are as follows:
script #1 finished in about an hour, total CPU load ~50% at boost clock (single Matlab instance)
script #2 finished in about HALF an hour (!), similar total CPU load ~50% at boost clock; main Matlab instance idle (~0%), spawned instance ~40%
I muss admit I do not understand the results: why does a spawned Matlab instance (i.e. two instances running in parallel: main/idle and active) complete the task in half of the time, compared to a single instance?
What might be the reason for this behavior?
Thanks a lot in advance!
MarekDear Community,
I am running Matlab 2024b under Windows 10 / 32GB RAM on a 6-core laptop Intel CPU (hyperthreading deactivated). For the sake of runtime optimisation I have done the following comparison:
case #1: a script running within the current Matlab session (single instance) and
case #2: the same script running in a spawned session (instance), using "!matlab -nosplash -desktop -r "load …" (etc.).
The runtime results are as follows:
script #1 finished in about an hour, total CPU load ~50% at boost clock (single Matlab instance)
script #2 finished in about HALF an hour (!), similar total CPU load ~50% at boost clock; main Matlab instance idle (~0%), spawned instance ~40%
I muss admit I do not understand the results: why does a spawned Matlab instance (i.e. two instances running in parallel: main/idle and active) complete the task in half of the time, compared to a single instance?
What might be the reason for this behavior?
Thanks a lot in advance!
Marek Dear Community,
I am running Matlab 2024b under Windows 10 / 32GB RAM on a 6-core laptop Intel CPU (hyperthreading deactivated). For the sake of runtime optimisation I have done the following comparison:
case #1: a script running within the current Matlab session (single instance) and
case #2: the same script running in a spawned session (instance), using "!matlab -nosplash -desktop -r "load …" (etc.).
The runtime results are as follows:
script #1 finished in about an hour, total CPU load ~50% at boost clock (single Matlab instance)
script #2 finished in about HALF an hour (!), similar total CPU load ~50% at boost clock; main Matlab instance idle (~0%), spawned instance ~40%
I muss admit I do not understand the results: why does a spawned Matlab instance (i.e. two instances running in parallel: main/idle and active) complete the task in half of the time, compared to a single instance?
What might be the reason for this behavior?
Thanks a lot in advance!
Marek multiple instance spawn MATLAB Answers — New Questions