Skip to content

Use AsSpan/AsMemory slice constructor#14265

Merged
iSazonov merged 2 commits into
PowerShell:masterfrom
xtqqczze:asspan-slice
Nov 27, 2020
Merged

Use AsSpan/AsMemory slice constructor#14265
iSazonov merged 2 commits into
PowerShell:masterfrom
xtqqczze:asspan-slice

Conversation

@xtqqczze
Copy link
Copy Markdown
Contributor

Follow-up to #13500.

AsSpan().Slice(start, length) -> AsSpan(start, length)

Micro-benchmarks show decrease in code size and ~1.6x speedup.

@xtqqczze
Copy link
Copy Markdown
Contributor Author

@iSazonov Should we label the arguments, i.e. AsMemory(0, index) -> AsMemory(start: 0, length: index)?

@iSazonov iSazonov added the CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log label Nov 25, 2020
@iSazonov
Copy link
Copy Markdown
Collaborator

@iSazonov Should we label the arguments, i.e. AsMemory(0, index) -> AsMemory(start: 0, length: index)?

I think we can skip this as obvious.

@iSazonov iSazonov merged commit dc9ecd9 into PowerShell:master Nov 27, 2020
@iSazonov iSazonov assigned iSazonov and unassigned TravisEz13 Nov 27, 2020
@iSazonov iSazonov added this to the 7.2.0-preview.2 milestone Nov 27, 2020
@xtqqczze xtqqczze deleted the asspan-slice branch November 27, 2020 12:04
@ghost
Copy link
Copy Markdown

ghost commented Dec 15, 2020

🎉v7.2.0-preview.2 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants