Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Performance of Set Observable properties of Matlab Objects
Replies: 1   Last Post: Jul 18, 2013 3:41 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Dave Foti

Posts: 6
Registered: 7/8/08
Re: Performance of Set Observable properties of Matlab Objects
Posted: Jul 18, 2013 3:41 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

While I can't be certain, based on the decription, the time appears to be spent determining what objects are still referenced. One source of time not charged by the profiler to particular lines of code is the time spent destroying a function workspace. This can take a long time if the workspace contains handles to objects and it is not obvious to the system that such handle is either the last references to an object or definitely not the last reference. Earlier versions of MATLAB use a combination of reference counting and a form of cycle detection to ensure that cycles of objects aren?t orphaned. The cycle detection can be very expensive but various optimizations allow cycle detection information to be cached and reused when later references are removed. I suspect that the act of creating the property change event for the SetObservable Data property causes one of these caches to be
invalidated and forces a traversal of all the connected objects and data. Even though there are no listeners, a temporary reference to the Source object is created and then destroyed and this action can invalidate cached cycle-related information. MATLAB versions since R2011b have a new lifecycle management system that is designed to provide faster and more uniform performance.

-Dave

"Joseph Burgel" wrote in message <kmgb90$sos$1@newscl01ah.mathworks.com>...
> 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




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.