The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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.


"Joseph Burgel" wrote in message <kmgb90$sos$>...
> 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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.