This project is read-only.
1
Vote

Poor performance

description

Ever since moving our DNN site to Azure, performance of this module has been quite poor.
I have been tracking this pretty much down to number of database calls and especially one method: RepositoryDashboard.RecalcCategoryCount

By making this change below, page download time went from 10 seconds to 2 seconds:

This is the original code:
' recalc the category counts
        'For Each category As RepositoryCategoryInfo In categories
        '    For Each item As RepositoryInfo In bindableList
        '        Dim cats As ArrayList = rc.GetRepositoryObjectCategories(item.ItemId)
        '        For Each _cat As RepositoryObjectCategoriesInfo In cats
        '            If _cat.CategoryID = category.ItemId Then
        '                category.Count = category.Count + 1
        '                'DotNetNuke.Instrumentation.DnnLogger.GetLogger("RepositoryDashboard").Debug("Category " & category.Category & " count: " & category.Count)
        '            End If
        '        Next
        '    Next
        'Next
New code:
        For Each item As RepositoryInfo In bindableList
            Dim cats As ArrayList = rc.GetRepositoryObjectCategories(item.ItemId)
            For Each _cat As RepositoryObjectCategoriesInfo In cats
                For Each category As RepositoryCategoryInfo In categories
                    If _cat.CategoryID = category.ItemId Then
                        category.Count = category.Count + 1
                        'DotNetNuke.Instrumentation.DnnLogger.GetLogger("RepositoryDashboard").Debug("Category " & category.Category & " count: " & category.Count)
                    End If
                Next
            Next
        Next

comments