Making Performance Optimizations to the Object Model

We're going to look at two methods of optimizing, the model and the fetches it performs.

Introduction to Prefetching

The first method we'll look at is a fairly simple method to use.

You might have noticed that displaying the list of Forum.moderators, on the Main page, resulted in the fetching of the moderators for each of the forums listed. This would have consisted of two fetches per forum. One for the JOIN table and the second from the USER table.

When an Enterprise Object is fetched, its related objects are not fetched along with it. This is for performance and efficiency.

Imagine if this were the case. Then an entire object graph would be pulled into memory when an Enterprise Object is ...

Get WebObjects® Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.