Skip to content

Commit

Permalink
Improve ArraySegmentStream with ReadOnlyMemory/Span signatures, avoid…
Browse files Browse the repository at this point in the history
… extra alloc/copy (#2556)

- Implement `int Read(Span<byte> buffer)` and `void Write(ReadOnlySpan<byte> buffer)` in ArraySegmentStream
- for ArraySegmentStream streaming lower the CPU load for .NET8 OPC UA binary encoding/decoding by 50%
- Implement dispose to return buffers that were not transferred. 
- Implement a GetSequence in ArraySegmentStream
  • Loading branch information
mregen committed Mar 29, 2024
1 parent d717f67 commit ebb55ad
Show file tree
Hide file tree
Showing 24 changed files with 2,435 additions and 1,290 deletions.
9 changes: 5 additions & 4 deletions .azurepipelines/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ jobs:
inputs:
targetType: filePath
filePath: ./.azurepipelines/get-matrix.ps1
arguments: -FileName azure-pipelines.yml -AgentTable ${{ parameters.agents }}
arguments: -FileName *.Tests.csproj -AgentTable ${{ parameters.agents }}
- job: testall${{ parameters.jobnamesuffix }}
displayName: Tests (${{ parameters.framework }})
dependsOn: testprep${{ parameters.jobnamesuffix }}
timeoutInMinutes: 120
strategy:
matrix: $[dependencies.testprep${{ parameters.jobnamesuffix }}.outputs['testmatrix.jobMatrix'] ]
variables:
Expand Down Expand Up @@ -62,12 +63,12 @@ jobs:
displayName: Restore ${{ parameters.configuration }}
inputs:
command: restore
projects: '**/*.Tests.csproj'
projects: $(file)
arguments: '${{ variables.DotCliCommandline }} --configuration ${{ parameters.configuration }}'
- task: DotNetCoreCLI@2
displayName: Test ${{ parameters.configuration }}
timeoutInMinutes: 60
timeoutInMinutes: 30
inputs:
command: test
projects: '**/*.Tests.csproj'
projects: $(file)
arguments: '--no-restore ${{ variables.DotCliCommandline }} --configuration ${{ parameters.configuration }}'
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,12 @@ dotnet_diagnostic.IDE1005.severity =
# CA1305: Specify IFormatProvider
dotnet_diagnostic.CA1305.severity = warning

# CA1819: Properties should not return arrays
dotnet_diagnostic.CA1819.severity = silent

# CA1721: The property name is confusing given the existence of another method with the same name.
dotnet_diagnostic.CA1721.severity = silent

# exclude generated code
[**/Generated/*.cs]
generated_code = true
Expand Down
Loading

0 comments on commit ebb55ad

Please sign in to comment.