Yes, I did a quick benchmark test on a small data set (12 rows). What I did was, insert a new grade to the database for a corresponding ID, then re-calculate the new average rating for that corresponding ID and output it to the screen.
Using MySQL AVG(): Finished in 0.001843 seconds
Using my algorithm: Finished in 0.001113 seconds
0.0007 seconds of difference and we're dealing with only 12 rows, plus the database server and the web server are located on the same machine.
That's without retrieving the total number of ratings forming the average rating for the given ID. If I wanted to do that, I would have to execute a statement like this:
AVG(rating) AS avg_raging, COUNT(rating) as votes_count
WHERE some_id = <some_value>
GROUP BY some_id
In which case the benchmark results on the same data set are as follows:
Using MySQL AVG(): Finished in 0.001865 seconds
Using my algorithm: Finished in 0.001128 seconds
0.0007 seconds may seem like a tiny difference on small data sets, but imagine you're dealing with a popular website, with a few hundred millions of unique visitors per month..