Chuck,

On 16. 2. 2015, at 2:58, Chuck Hill <[email protected]> wrote:

> It would be very beneficial to speed up orderedPriceOffers ... It is used 
> elsewhere too
...
> I was thinking more of fetch exactly what you need on demand than of caching. 
>  You can cache, but at you note it gets very complicated quickly.

So, just plain ole

===
def orderedPriceOffers {
  return this.editingContext.objectsWithFetchSpecification( yadda yadda incl 
sort orderings )
}
===

nothing less, nothing more?

But that will do a DB round-trip each time it gets called, would it not? And 
well I did not benchmark (will do asap), but I understand that whilst the DB 
itself is very fast, those round-trips are expensive, and it is one of pretty 
important tasks of EOF to prevent them if possible?

> If you only need the single, most recent valid price, then fetch that.

As noted above, in different places I need both the ordered list (often) and 
the last valid price (VERY often, and often inside of a loop which makes some 
caching a must).

Nevertheless with the last valid thing I already took your advice and modelled 
it -- I dodged changing the DB for I was lucky and I happened to have in my 
model one legacy unused INTEGER attribute, which I used for a FK -- and 
preliminarily, it seems to work excellently.

Thanks a lot!
OC


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to