Skip to content

Use stackalloc instead of new to optimize performance#1

Open
NCLnclNCL wants to merge 1 commit intoTan90909090:mainfrom
NCLnclNCL:patch-1
Open

Use stackalloc instead of new to optimize performance#1
NCLnclNCL wants to merge 1 commit intoTan90909090:mainfrom
NCLnclNCL:patch-1

Conversation

@NCLnclNCL
Copy link

use stackalloc instead of new for optimize performance
@Tan90909090
Copy link
Owner

The compiler optimize a code if new byte[]{...} is converted to ReadOnlySpan<byte>. see https://vcsjones.dev/csharp-readonly-span-bytes-static/

Therefore, I don't think that change will lead to performance improvements.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments