If I were developing a such plugin, I would save the counter to post meta or even directly in wp_posts table (it is probably against to wp concept, but who cares) to have a good performance (I guess).
As far as I remember INNER JOINs are evil.
It’s all about SQLs.
View post on imgur.com
I just leaved only one call of:
$top_posts0 = get_tptn_pop_posts( array(
'limit' => 6,
'strict_limit' => false,
'post_type' => 'artist'
));
without any further calls (order by postnumber, loop, etc.). And just getting top posts took 3.8s:
View post on imgur.com
And I’m not sure why does it look in all post types while I ask to show me certain 'post_type' => 'artist'
Note: my database is huge ~500.000 posts, but not so huge for these numbers.
I used Query Monitor plugin for that.