|
$first = 10000 |
|
|
|
Write-Host "Scripts" -ForegroundColor Red |
|
|
|
Measure-Command { |
|
$measure = ` |
|
Find-Item ` |
|
-Index sitecore_master_index ` |
|
-Where 'Path.StartsWith(@0) and TemplateName = @1' ` |
|
-WhereValues "/sitecore/system/modules/PowerShell/", "PowerShell Script" ` |
|
-First $first | |
|
Measure-Object |
|
Write-Host "Dynamic: $($measure.Count) " -f Cyan -NoNewline |
|
} | % { Write-Host "$($_.Milliseconds) ms" } |
|
|
|
Measure-Command { |
|
$measure = ` |
|
Find-Item ` |
|
-Index sitecore_master_index ` |
|
-Criteria @{Filter = "StartsWith"; Field = "_fullpath"; Value = "/sitecore/system/modules/PowerShell/"}, |
|
@{Filter = "Equals"; Field = "_templatename"; Value = "PowerShell Script"} ` |
|
-First $first | |
|
Measure-Object |
|
Write-Host "Criteria: $($measure.Count) " -f Cyan -NoNewline |
|
} | % { Write-Host "$($_.Milliseconds) ms" } |
|
|
|
Write-Host "Templates" -ForegroundColor Red |
|
|
|
Measure-Command { |
|
$measure = ` |
|
Find-Item ` |
|
-Index sitecore_master_index ` |
|
-Where 'TemplateName = @0 And Language=@1' ` |
|
-WhereValues "Template Field", "en" ` |
|
-First $first | |
|
Measure-Object |
|
Write-Host "Dynamic: $($measure.Count) " -f Cyan -NoNewline |
|
} | % { Write-Host "$($_.Milliseconds) ms" } |
|
|
|
Measure-Command { |
|
$measure = ` |
|
Find-Item ` |
|
-Index sitecore_master_index ` |
|
-Criteria @{Filter = "Equals"; Field = "_templatename"; Value = "Template Field"; CaseSensitive = $true}, |
|
@{Filter = "Equals"; Field = "_language"; Value = "en"; CaseSensitive = $true} -first $first | |
|
Measure-Object |
|
Write-Host "Criteria $($measure.Count) " -f Cyan -NoNewline |
|
} | % { Write-Host "$($_.Milliseconds) ms" } |
|
|
|
Measure-Command { |
|
$measure = ` |
|
Get-Item master:\ -Query 'fast:/sitecore//*[@@TemplateName="Template Field"]' | |
|
Measure-Object |
|
Write-Host "FastQuery $($measure.Count) " -f Cyan -NoNewline |
|
} | % { Write-Host "$($_.Milliseconds) ms" } |
|
|
|
Measure-Command { |
|
$measure = ` |
|
Get-ChildItem master:\templates\ -recurse | |
|
?{ $_.TemplateID -eq "{455A3E98-A627-4B40-8035-E683A0331AC7}" } | |
|
Measure-Object |
|
Write-Host "Children $($measure.Count) " -f Cyan -NoNewline |
|
} | % { Write-Host "$($_.Milliseconds) ms" } |