Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize TagReader/TagWriter #21

Open
ForeverZer0 opened this issue Aug 27, 2023 · 0 comments
Open

Optimize TagReader/TagWriter #21

ForeverZer0 opened this issue Aug 27, 2023 · 0 comments
Assignees
Labels
optimization Performance improvement
Milestone

Comments

@ForeverZer0
Copy link
Owner

The TagReader and TagWriter class still use the naive and legacy method of BitConverter.GetBytes paired with Array.Reverse to get the correct byte-order.

Replace all these method calls with the use of stackalloc spans and employ BinaryPrimitives methods to read/write in the appropriate endian. This will make them free of any heap-allocations in additional to being computationally less expensive.

@ForeverZer0 ForeverZer0 added the optimization Performance improvement label Aug 27, 2023
@ForeverZer0 ForeverZer0 added this to the 2.0 milestone Aug 27, 2023
@ForeverZer0 ForeverZer0 self-assigned this Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization Performance improvement
Projects
None yet
Development

No branches or pull requests

1 participant