This second part will analyze GD Star Rating impact on blog pages. This post will focus on number of queries that GD Star Rating adds to a page. There are many factors that must be taken into account, but I will cover most interesting cases of use.
The part of this test was memory use and generated page size, and that part of the test I will skip here, because results are covered in the post on Dev4Press, so go there are read on general blog performance. As for this most important test, I used default WordPress theme, and I first measured use of standard ratings, and than multi ratings. Also, since the number of queries for the plugin doesn’t depend on WordPress version, I will use WP 2.8 for the tests.
Also, 1.5.1 introduced massive SQL queries optimizations that will be explained in the tests done bellow. One thing I didn’t measured is using GD Star Rating widgets, because each widget instance requires 1 (or 2 if you use trends) query to be executed, so there is nothing to measure, that’s the constant value.
So, if you look at the first graph, you can see blue bars that are clean WP installation (WP 2.8) without GD Star Rating. Red one is with GD Star Rating 1.4.8, and green is 1.5.2. First set is front page with 10 posts, and no auto-insert from the plugin, and basically no ratings are visible at this point. But 1.4.8 adds 23 SQL queries, while 1.5.2 adds only 3. These 3 queries are IP checks to see if the IP from where the request is coming is blacklisted. This can be disabled.
On the second set of bars we now have auto-insert active, and all 10 posts have standard ratings. 1.4.8 adds 69 queries and 1.5.2 adds only 8, that’s less then a query per post. If you disable IP check, 1.5.2 adds only 5 queries for 10 posts. Actually if you have 20 posts on front page, 1.4.8 will add some 144 queries, but 1.5.2 still adds only 8.
Single post with no comments and single page act very much the same, and 1.4.8 adds 11 and 10 queries, 1.5.2 adds one query less. Again, big difference is with post with comments. 1.4.8 adds 70 queries for 10 comments, 1.5.2 adds 15. And even if we have 50 comments on a post, 1.5.2 will still add only 15 queries and 1.4.8 will add close to 350 queries.
I also did some research into other ratings plugins, but there is only one plugin still relevant, and that’s Lester Chan’s WP Post Ratings. If you use it one the front page with 10 posts, this plugin will add 12 queries, and that is 4 queries more than GD Star Rating 1.5.2. Consider the fact that WP Post Ratings has only a fraction of features that GD Star Rating does, that can’t be customized beyond choosing the graphics, and that only works with posts and now no longer has advantage of small number of SQL queries needed, than it’s obvious that GD Star Rating now is definitely number 1 rating plugin for WordPress.
As you can see there is no doubt that 1.5.2 is much better, and that optimizations are clearly visible. I have tested only standard ratings for now, because with multi ratings things are more or less fixed, and each post that uses multi ratings will execute 3 queries to get all data needed. If you use integration into comments, each comments specific rating requires 2 queries. There will be more optimizations done in this part, and I will work to reduce some of the queries executed for multi ratings.
a WordPress rating system