-
-
Notifications
You must be signed in to change notification settings - Fork 43
perf: Views engine render optimizations — warm 99.99% faster, cold 10% faster #724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
johnml1135
wants to merge
2
commits into
main
Choose a base branch
from
001-render-speedup
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,131 @@ | ||
| <# | ||
| .SYNOPSIS | ||
| Runs the render-focused test suites for FieldWorks. | ||
|
|
||
| .DESCRIPTION | ||
| Executes the DetailControls render tests and the RootSite render tests sequentially. | ||
| This script is intentionally outside the product project graph so developers can use a | ||
| single entrypoint without introducing a meta test project into the repository architecture. | ||
|
|
||
| .PARAMETER Scope | ||
| Which render suites to run. Default is All. | ||
|
|
||
| .PARAMETER Configuration | ||
| The build configuration to test. Default is Debug. | ||
|
|
||
| .PARAMETER NoBuild | ||
| Skip building before running tests. | ||
|
|
||
| .PARAMETER Verbosity | ||
| Test output verbosity: quiet, minimal, normal, detailed. | ||
|
|
||
| .PARAMETER SkipDependencyCheck | ||
| Skip dependency preflight checks inside test.ps1. | ||
| #> | ||
| [CmdletBinding()] | ||
| param( | ||
| [ValidateSet('All', 'DetailControls', 'RootSite')] | ||
| [string]$Scope = 'All', | ||
| [string]$Configuration = 'Debug', | ||
| [switch]$NoBuild, | ||
| [ValidateSet('quiet', 'minimal', 'normal', 'detailed', 'q', 'm', 'n', 'd')] | ||
| [string]$Verbosity = 'normal', | ||
| [switch]$SkipDependencyCheck | ||
| ) | ||
|
|
||
| Set-StrictMode -Version Latest | ||
| $ErrorActionPreference = 'Stop' | ||
|
|
||
| $repoRoot = [System.IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..\..')) | ||
| $buildScript = Join-Path $repoRoot 'build.ps1' | ||
| $testScript = Join-Path $repoRoot 'test.ps1' | ||
|
|
||
| if (-not (Test-Path $buildScript)) { | ||
| throw "build.ps1 not found at $buildScript" | ||
| } | ||
|
|
||
| if (-not (Test-Path $testScript)) { | ||
| throw "test.ps1 not found at $testScript" | ||
| } | ||
|
|
||
| $requestedScopes = switch ($Scope) { | ||
| 'All' { @('DetailControls', 'RootSite') } | ||
| default { @($Scope) } | ||
| } | ||
|
|
||
| function Invoke-RenderSuite { | ||
| param( | ||
| [Parameter(Mandatory = $true)] | ||
| [string]$Name, | ||
| [Parameter(Mandatory = $true)] | ||
| [string]$BuildProject, | ||
| [Parameter(Mandatory = $true)] | ||
| [string]$TestProject, | ||
| [Parameter(Mandatory = $true)] | ||
| [string[]]$TestFilters | ||
| ) | ||
|
|
||
| if (-not $NoBuild) { | ||
| Write-Output "Building $Name render tests..." | ||
|
|
||
| $buildArgs = @{ | ||
| Configuration = $Configuration | ||
| Project = $BuildProject | ||
| Verbosity = $Verbosity | ||
| } | ||
|
|
||
| if ($SkipDependencyCheck) { | ||
| $buildArgs['SkipDependencyCheck'] = $true | ||
| } | ||
|
|
||
| & $buildScript @buildArgs | ||
| if ($LASTEXITCODE -ne 0) { | ||
| throw "$Name render build failed with exit code $LASTEXITCODE." | ||
| } | ||
| } | ||
|
|
||
| foreach ($testFilter in $TestFilters) { | ||
| Write-Output "Running $Name render tests with filter '$testFilter'..." | ||
|
|
||
| $testArgs = @{ | ||
| Configuration = $Configuration | ||
| TestProject = $TestProject | ||
| TestFilter = $testFilter | ||
| Verbosity = $Verbosity | ||
| NoBuild = $true | ||
| SkipDependencyCheck = $true | ||
| } | ||
|
|
||
| & $testScript @testArgs | ||
| if ($LASTEXITCODE -ne 0) { | ||
| throw "$Name render tests failed with exit code $LASTEXITCODE for filter '$testFilter'." | ||
| } | ||
| } | ||
|
|
||
| Write-Output "[OK] $Name render tests passed." | ||
| } | ||
|
|
||
| foreach ($requestedScope in $requestedScopes) { | ||
| switch ($requestedScope) { | ||
| 'DetailControls' { | ||
| Invoke-RenderSuite ` | ||
| -Name 'DetailControls' ` | ||
| -BuildProject 'Src/Common/Controls/DetailControls/DetailControlsTests/DetailControlsTests.csproj' ` | ||
| -TestProject 'Src/Common/Controls/DetailControls/DetailControlsTests' ` | ||
| -TestFilters 'FullyQualifiedName~DataTreeRenderTests' | ||
| } | ||
| 'RootSite' { | ||
| Invoke-RenderSuite ` | ||
| -Name 'RootSite' ` | ||
| -BuildProject 'Src/Common/RootSite/RootSiteTests/RootSiteTests.csproj' ` | ||
| -TestProject 'Src/Common/RootSite/RootSiteTests' ` | ||
| -TestFilters @( | ||
| 'FullyQualifiedName~RenderBaselineTests', | ||
| 'FullyQualifiedName~RenderTimingSuiteTests', | ||
| 'FullyQualifiedName~RenderVerifyTests' | ||
| ) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| Write-Output 'All requested render suites passed.' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.