Store
Community Documentation

v3 Knowledgebase

Quick benchmark on new add-ons

Pretty much every add-on you can install will pose a level of stress on your site affecting performance, for this tutorial we will look at a few simple metrics we can take to grant a performance rating on new add-ons.

We will assume we are installing an add-on that somehow affects the dashboard of logged in members, it can affect other areas too but this example will only take on this section. If you want to benchmark an add-on that affects other section apply the same technique to that section. Also, don't forget that if an add-on you're benchmarking does not affect directly the dashboard for logged in members then this example does not apply to your case.

The first thing to do is enable debug mode on level 3 and go to the dashboard as a logged in member.
After the normal page loads you will see the developer's debug. We need to take samples from this section so we can compare before installing the add-on and after installing the add-on.
The values we need to collect are:
PHP General Time: This tells how much did the PHP side of the script needed to generate a page.
SQL Time: This is how much time did the database need to return all the queries issued in this page.
SQL Queries: The number of queries needed to generate this page.

(PHP time + SQL time = Total time)

Now lets take 10 samples of these 3 values: refresh the page and write down the values, do this 10 times and calculate the average for each, in my test this is what I got:
PHP time:
0.513006
0.8770789
0.8559826
0.8769907
0.949581
0.8577418
1.0661639
0.8914599
0.998615
1.1180316

SQL time:
0.0262539
0.0157159
0.0084505
0.0109724
0.0124761
0.0080722
0.0249733
0.0098792
0.0209070
0.0310146

SQL queries:
98
81
80
80
80
80
80
80
80
80

And the averages:
PHP time: 0.90046514
SQL time: 0.01687151
SQL Queries: 81.9

Now we have some hard numbers to crunch against the post-install test, so install your add-on and do this process again. You can compare both results to see how much installing that add-on is costing your site in terms of performance.

Notes:
- Do not disable or enable caches during tests or that would give you bogus results.
- Make sure the add-on is properly installed (some plug-ins may need to be manually enabled)