Last night, or early this morning depending on your view of today/yesterday, I had to do a production push for a client. Since the time I was able to do this was limited, for good reason being its a very active site, I had a couple hours of down time waiting for it. So, I decided to take Shaun's advice and do some SQL Profiling of the previous forum release vs. the current one (going through the process) using a copy of dnn.com data.
My initial results were pretty good. The time it took to view a previously viewed group page, then view the aggregated forum, then view a specific post was about 11 seconds in database execution time for 3.20.8-.9. In the forum 4.4 version this time was drastically reduced to 6 seconds. While I was quite happy with this, Shaun pointed out to me that reducing the db calls is what he typically focuses on. Since forums are very user specific when it comes to things such as forum and thread reads, I knew my options were somewhat limited.
Since the module has its own form of permissions (to handle permissions forum by forum) I knew there should be some focus here. The module permissions grid was originally copied then slightly modified to serve as the permissions grid at the forum level. Changing one of the method signatures to retrieve from cache, reduced the average number of db hits to a page by 1 db call per forum. (On dnn.com this can amount to 100 fewer db hits). The next item was to eliminate db hits for unauthenticated users for forum and thread reads. Since users are not logged in, all forum and thread read status should be disabled. Changing this saved an additional db hit per forum (in group view) and an additional db hit per thread (in thread view). The number of hits depends ultimately on the number of forums or threads in the view.
The time it took to run the tests and change the code? About 1 hour. So, for the 1 hour I spent doing this I reduced database calls from the previous version and reduced the 11 seconds it took originally down to 4. (Remember, this is 3 seperate views) Just an FYI, I had already used ANTS Profiler (a Red-Gate product) previously to analyze and reduce code calls where necessary.