I just came across a similar issue. The problem was that the theme was updating options on the ‘init’ action hook.
function theme_setup() {
update_option('thumbnail_size_w', 170);
update_option('medium_size_w', 470);
update_option('large_size_w', 970);
}
add_action('init', 'theme_setup');
That is called on every page load. This is better done using the ‘after_switch_theme’ action hook which only takes place when the theme is activated.
function theme_setup() {
update_option('thumbnail_size_w', 170);
update_option('medium_size_w', 470);
update_option('large_size_w', 970);
}
add_action('after_switch_theme', 'theme_setup');
This change saved 3 database updates on every page load.