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