Twitter Blackbird Pie
Performance improvements in latest version of Twitter Blackbird (2 posts)

  1. jose.sg
    Posted 4 years ago #

    So I've been doing a few performance enhancements at work and stumbled upon an installation of this plugin in our blog. It was doing ~70 queries on any given page, 1 for every author of our blog. Awesome stuff.

    Even placing the queries behind APC means that each fresh, un-cached page view will result in about 70 extra queries to our database. 70 queries that can be all done at once, en masse.

    It appears that the problem function is BlackbirdPie->embed_head(). I've attached a single gist that fixes the issue for our use case. We don't allow non-author users on our blog, so I didn't need to verify that the user_id and twitter handle was attached to an editor etc., but if this is necessary, we can do this via a join, requiring still only a single query, as opposed to 1 per WordPress user.

    Feel free to critique the code change itself, I look forward to getting some conversation going on this. I'm sure there are others out there who have this issue and don't even know it ;)



  2. bradvin
    Plugin Author

    Posted 4 years ago #

    thanks for posting this code. I will look into this issue, go over your code changes, and post an update to the plugin

    many thanks

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic