Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

End statement constitutes 28s of execution time...options?

3 vues (au cours des 30 derniers jours)
Vladimir
Vladimir le 29 Août 2011
Clôturé : MATLAB Answer Bot le 20 Août 2021
I have some object oriented MATLAB functions running through several iterations over tiles of an image. I profiled the code to optimize for testing on a set of 3800+ images. The issue is that the profiler tells me that 1 simple end statement with a comment afterwards is taking 28s of the 150s total execution time, being parsed 357,000+ times. All appropriate code optimizations have been made. This similarly occurs in another function, consuming 8 more seconds in 706,000+ parsings...Additionally, an if statement with 4 clauses consumes 13s with the same number of parsings.
Firstly, I don't understand how an end statement being parsed nearly twice as many times is nearly 4 times faster to parse than another end statement. Secondly, how has Mathworks not found a solution to this issue...?
Is the parsed characteristic of MATLAB code execution really introduce such terrible overhead? Are there any settings I can change? I'm avoiding the use of MEX files if possible. Looking to not run 3800 tests over 7 days...
Thanks in advance, Vlad

Réponses (0)

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by