Skip to content

Question: Remoting, serialization optimization? #1374

@Antonytm

Description

@Antonytm

I run 2 scripts

  1. In Sitecore Powershell ISE
    $criteria = @(
        @{Filter = "Equals"; Field = "_haslayout_b"; Value = $True}
    )
    $props = @{
        Index = "sitecore_master_index"
        Criteria = $criteria
    }

    Find-Item @props
  1. In Powershell ISE on the same machine
Import-Module -Name SPE
$session = New-ScriptSession -Username admin -Password b -ConnectionUri https://xmcloudcm.localhost/

Invoke-RemoteScript -ScriptBlock {
    $criteria = @(
        @{Filter = "Equals"; Field = "_haslayout_b"; Value = $True}
    )
    $props = @{
        Index = "sitecore_master_index"
        Criteria = $criteria
    }

    Find-Item @props
} -Session $session

The first script executes immediately. It returns 400 records.
The second script runs for a very long time, or forever. After finishing, Sitecore starts to work slowly. Even the first script executes much more slowly.

When I optimize the script with Select-Object and select only the fields that I need, the issue disappears.

But the serialization of 400 search results doesn't sound like something crazy. Additionally, Sitecore is starting to work slowly after performing the serialization, so there may be an issue with the serialization process.

Question:
Is Sitecore PowerShell Remoting rely on Microsoft CLIXML binaries? Or is it something inside this repository that probably could be optimized?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions