Let's say I've already got the $post object through some earlier process of looping through an array of IDs and using get_post() on each one of them, storing the resulting object in some array.
Later on, I want to loop through that array and do something with each post. I already have a $my_post object, so I could
echo $my_post->post_title, or I could get fancy and
echo apply_filters('the_title', $my_post->post_title, $my_post->ID) or I could just use the native
Here's where my performance question comes in. How reliable is the native cache (I'm not talking about some crazy plugin, just the built-in
wp_cache_get($post_id, 'posts') etc..)?
I guess what I'm asking is: what is the likelihood that get_the_title() will dip back into the DB and re-grab the post, as opposed to using the cache, and would I be better off from a performance perspective just using the object data that I already have? Clearly you get more sugar if you use the built-in stuff. But does it risk going back to the DB?