Re: Which way is more efficient to get particular EOEnterpriseObject
Re: Which way is more efficient to get particular EOEnterpriseObject
- Subject: Re: Which way is more efficient to get particular EOEnterpriseObject
- From: Chuck Hill <email@hidden>
- Date: Wed, 15 Aug 2007 21:57:06 -0700
On Aug 15, 2007, at 9:12 PM, Gennady Kushnir wrote:
With a hundred objects, that is quite okay. If you have to do it
multiple times, it might be an idea to convert it into a dictionary
and base the keys on the attributes you're looking for - if that is
doable. You haven't given enough information here.
In fact, building a dictionary - it is what I ment by "indexing".
Maybe
that's not correct to call it so.
- just fetch required object regarding mentioned relationship as
just one
of attributes involved
If your array grows to a size that a linear scan or a building a
hashtable (dictionary) is to expensive, a database roundtrip might be
the fastest way if you can use indexes for everything.
Only for that HUUGE arrays? I thowght, that caching of objects,
that EOF
do shoud significally speed up fetches... Will it do real database
roundtrip for fetching an object that's already cached in memory?
(I know
it is, as it is in that array in relationship attribute)
Fetches always go to the database. EOF only uses the cache when
firing faults.
Chuck
And the other thing is: implement it in the easiest possible way, so
you don't waste resources on it and see whether it is actually too
slow. Never optimize anything that doesn't need optimization. Use the
simplest code you can write to get the job done and optimize only, if
that is too slow. Developer time is normally much more expensive than
CPU time.
Thank you for that advice, I'll take it into accont ))
In fact when I'm trying to "opimise" I optimise both CPU and developer
time. In this particut=lar case - it would be much easier to utilise a
structured hashtable than to write a cycle or qualifier each time I
mant
to get something from that unstructured array.
Thank you all who replied.
I think I'll buld a hashtable on demand (when this kind of query
is first
required).
--
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