UDTable - Column rendering is slow

I have several places where i use UDTable and the rendering function to get a link that directs you to a detail page. For some reason the rendering is very slow when i load the page, is there anything i can do to make it faster? I am runing Powershell Universal 1.4.3 and Powershell 7.0.3

$MyColumns = @(
    New-UDTableColumn -Property Name -Title "Name" -Render {
        $Item = $Body | ConvertFrom-Json 
        New-UDLink -Url "/Details/$($Item.UUID)" -Text $Item.Name
    }
    New-UDTableColumn -Property Version -Title "Version"
    New-UDTableColumn -Property IPAddress -Title "IP Address"
)

While I don’t have a fix, I wanted to add that I am experiencing the same issues with UD-Table. The text of the table populates fast , but then the icons and buttons I show with -Render take painfully long to load. To load a table with 100 rows it takes more than 60 seconds to render all the button and Icons. Its giving the impression that the dashboard is slow when it just seems to be these components. I tried it with 1.4.3 on my Test dashboard and the nightly build 1.5 on my dev dashboard and they both experience this.

1 Like

Let me see what I can do. I can reproduce this when I crank up the number of rows. It seems to get slower and slower the more rows that are added.

I’ve figured out a way to speed this up significantly. It won’t do HTTP call backs for the rendering any more and will just run a single PS execution. It’ll be in tonight’s nightly and 1.4.5 when it comes out.

$DebugPreference = 'Continue'

New-UDDashboard -Title 'Performance Data' -Content {
    $Columns = @(
        New-UDTableColumn -Property Name 
        New-UDTableColumn -Property Value -Render {
            New-UDButton -Text $EventData.Value
        }
    )
    New-UDTable -LoadData {
        1..100 | % { @{ Name = "Test$_"; Value = $_ } } | Out-UDTableData -Page 0 -TotalCount 100 -Properties @("Name", "Value")
    } -Column $Columns -pageSize 100

    $Columns = @(
    New-UDTableColumn -Property Dessert -Title "A Dessert" -Render { New-UDButton -Text $EventData.Dessert }
    New-UDTableColumn -Property Calories -Title Calories 
    New-UDTableColumn -Property Fat -Title Fat 
    New-UDTableColumn -Property Carbs -Title Carbs 
    New-UDTableColumn -Property Protein -Title Protein 
)

New-UDTable -Columns $Columns -LoadData {
    $Query = $Body | ConvertFrom-Json

    <# Query will contain
        filters: []
        orderBy: undefined
        orderDirection: ""
        page: 0
        pageSize: 5
        properties: (5) ["dessert", "calories", "fat", "carbs", "protein"]
        search: ""
        totalCount: 0
    #>

    @(
        @{Dessert = 'Frozen yoghurt'; Calories = (Get-Random); Fat = 6.0; Carbs = 24; Protein = 4.0}
        @{Dessert = 'Ice cream sandwich'; Calories = (Get-Random); Fat = 6.0; Carbs = 24; Protein = 4.0}
        @{Dessert = 'Eclair'; Calories = (Get-Random); Fat = 6.0; Carbs = 24; Protein = 4.0}
        @{Dessert = 'Cupcake'; Calories = (Get-Random); Fat = 6.0; Carbs = 24; Protein = 4.0}
        @{Dessert = 'Gingerbread'; Calories = (Get-Random); Fat = 6.0; Carbs = 24; Protein = 4.0}
    ) | Out-UDTableData -Page 0 -TotalCount 5 -Properties $Query.Properties 
}
}

1 Like

Also, we are working on adding a virtualization option to the table, to speed up the rendering, in our current test it took me an average of 8 sec to render 100k buttons

1 Like