Why does running get_the_excerpt() when generating JSON file take 28 seconds vs. 599 milliseconds without it?
The problem will likely be a (very slow) callback that is attached to your get_the_excerpt() function. To inspect the attached callbacks, just inspect the global: // Best hooked to `shutdown` echo ‘<pre>’.var_export( $GLOBALS[‘wp_filters’][‘get_the_excerpt’], true ).'</pre>’; Then get rid of all those callbacks.