UDTable - Column rendering is slow since version 2.8+

I was wondering why rendering costum columns on my live system was much slower than at my testing machine.
Only difference I found was the running version of PSU.
So I did some tests with different versions and my results are the following:

Creation of tables with a lot of rendered columns got realy slow since Version 2.8.
Works fine with version 2.7.*

render times on my test system:

2.8.0: 4,7 Seconds
2.7.5: 0,2 Seconds

Sample:

New-UDDashboard -Title 'Table Test' -Content {

$timer = [System.Diagnostics.Stopwatch]::StartNew()
$Data = @(
    @{Dessert = 'Frozen yoghurt'; Calories = 1; Fat = 6.0; Carbs = 24; Protein = 4.0}
    @{Dessert = 'Ice cream sandwich'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0}
    @{Dessert = 'Eclair'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0}
    @{Dessert = 'Cupcake'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0}
    @{Dessert = 'Gingerbread'; Calories = 200; Fat = 6.0; Carbs = 24; Protein = 4.0}
) 

$Data += $Data
$Data += $Data
$Data += $Data
$Data += $Data
$Data += $Data
$Data += $Data
$Data += $Data


$Columns = @(
    New-UDTableColumn -Property Dessert -Title Dessert -Render { 
        New-UDButton -Id "btn$($EventData.Dessert)" -Text "Click for Dessert!" -OnClick { Show-UDToast -Message $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 -Data $Data -Columns $Columns -Sort -Export

$timer.Stop()

#get timespan
$xtime = " " + $timer.Elapsed.Seconds + "." + $timer.Elapsed.Milliseconds
Show-UDToast -Title "Time: " -Message $xtime -Duration 30000

}
Product: PowerShell Universal
Version: 2.8+
OS: Windows 10

We had an issue introduced in 2.8 that was resolved in 2.10 that was causing really slow responses in dashboards. I’m not 100% sure this is the same thing but I just tried this in my 2.10.3 build it and renders your table in .4 seconds on my machine.

Thanks for the quick reply.
I just retried this at a clean VM (Windows 2019 Server) to make sure that there is not an issue on my end here.
Results are still very different.

2.7.5 : 0,2 Seconds
2.10.2: 1,8 Seconds
OS: Windows 2019 Server
Browser: Mozilla Firefox 100
PSU: 2.7.5
PSU: 2.10.2

Thanks for giving that a shot. Let me see if I can figure out what’s going on.

Works like a charm with the new version.
Thanks :slight_smile:

1 Like