This is more of a comment then a request for help but if any ML workers and give a reason for it, I'd love to know why. This is the result of a muliti-hour effort to performance optimize my code. I was using the profiler and kept getting one method that was taking up to 35 seconds to execute. The profiler (profile) was no help in that it said the time was being used as 'self time' defined as: "Self time is the time spent in a function excluding the time spent in its child functions. Self time also includes overhead resulting from the process of profiling." I added up all the time each line took to execute in my method and it added up to about .4 sec so that left 31.6 sec un-accounted for and no way to further deduce what was taking so long.
I then began a 'divide and concur' approach to finding the issue and determined it was being caused by clearing a Matlab OO property defined as follows:
properties (Access = 'public', Dependent = true, SetObservable) Data %The Data for the parameter. see Dimension. For type end
When I changed this to:
properties (Access = 'public', Dependent = true) Data %The Data for the parameter. see Dimension. For type end
The time to execute my method went to about .4 sec. So, I knew I was on to something. I then made sure it wasn't anything listening to this property and nothing was. NO LISTENERS on this property. Now, here's the interesting thing I found. I set the Data property back to SetObservable and ran the following code. Among other things, ResetCals() method simply sets Data = ;
ThisFile = load(FileName,'-mat'); tic ThisFile.ThisFile.Configurations(1).ResetCals(); toc Elapsed time is 32.078356 seconds.
A MASSIVE 31.5 seconds faster! Vehicle is a child object of a Configuration object. Vehicle keeps a reference property to it's parent configuration so the two snippets are calling the same method ultimately. Now, I set the Data property back to: properties (Access = 'public', Dependent = true) and re-run the same snippets and got these times respectively:
Elapsed time is 0.347201 seconds. Elapsed time is 0.314816 seconds.
So, this calling syntax together with a SetObservable property being called caused a 31 second difference in time. I have no idea why? Anyone?