• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: EOUtilities.LocalInstanceOfObject performance problem??
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EOUtilities.LocalInstanceOfObject performance problem??


  • Subject: Re: EOUtilities.LocalInstanceOfObject performance problem??
  • From: Chuck Hill <email@hidden>
  • Date: Wed, 13 Aug 2008 19:28:13 -0700


On Aug 13, 2008, at 7:25 PM, Dov Rosenberg wrote:

Hmmm - For example

Object A has a relationship to an NSArray of Object B's

In EC1 we retrieve A and access the relationship to the B's and get some of
the properties of the B's.


In EC2 we get a local instance of A and then access the same relationship to
the B's.


Does this local instance of A (in EC2) also give us a local instance of the
B's or does it cause us to refetch the B's into EC2?

That depends on the fetch timestamp in EC2 and whether it will accept the previously fetched data.



In our case we create a new EC because we use a SharedEC for read only data.
When we need to modify an object we create a new EC and set the reference to
the SharedEC to null and rely on the Object Store Coordinator to notify the
SharedEC when the change is committed. We need objects from the SharedEC so
we use LocalInstance to get one. In most cases the SharedEC objects that we
get the local instance of have relationships to objects that have already
been retrieved into the SharedEC.

I don't use the SharedEC. But it should not overly complicate this.

Chuck



On 8/13/08 10:12 PM, "Chuck Hill" <email@hidden> wrote:


On Aug 13, 2008, at 6:42 PM, Dov Rosenberg wrote:

Our code uses EOUtilities.LocalInstanceOfObject() on occasion.
Lately I have been seeing some strange slowdowns and the areas the
tend to show up in the thread dumps usually have this call near them.


The objects that we are getting a localInstance of also have
relationships that get accessed. Does the localInstance of an object
also get a localinstance of the relationship objects?

No, the related objects are faults that need to be fired.


Is there a performance hit for using this mechanism?

No, it just returns a fault based on the EOGlobalID. Very fast and light.



We have fixed other similar issues by just refetching the objects
into a new EditingContext instead of using localInstance.

I would expect that to be far, far slower.


Does LocalInstance scale under load properly?

There is nothing to scale.

Log the SQL and check that. You might be localInstancing into an EC
that is set to require new data. This can result in an lot of single
object trips to the database. But that is a data freshness issue, not
a localInstance concern.


Chuck




-- Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Re: EOUtilities.LocalInstanceOfObject performance problem?? (From: Dov Rosenberg <email@hidden>)

  • Prev by Date: Re: EOUtilities.LocalInstanceOfObject performance problem??
  • Next by Date: Re: EOUtilities.LocalInstanceOfObject performance problem??
  • Previous by thread: Re: EOUtilities.LocalInstanceOfObject performance problem??
  • Next by thread: Re: EOUtilities.LocalInstanceOfObject performance problem??
  • Index(es):
    • Date
    • Thread