That above while loop appears to take nearly 1 second per 50 book
objects. ???
Any time something is too slow, my first response is to sample the
app. You can use Activity Monitor to do this, or just type "sample
MyAppName 2" in a shell. Even if most of the time is spent in some
system framework, the symbol names are usually clues about what's
going on.
You can also use Shark if you want to get into more serious profiling,
but sampling is really quick and usually helpful.