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

ToSpan Allocates Extra Bytes in .NET 5 and .NET 6 #75

Open
SkyeHoefling opened this issue Jan 13, 2022 · 0 comments
Open

ToSpan Allocates Extra Bytes in .NET 5 and .NET 6 #75

SkyeHoefling opened this issue Jan 13, 2022 · 0 comments

Comments

@SkyeHoefling
Copy link
Contributor

Description

In both .NET 5 and .NET 6 benchmarks the ToSpan has extra allocations that don't make sense. This API wraps the native pointer from the encoders project and it shouldn't be creating any additional allocations. See benchmark table below.

The benchmarks have been ran on different machines the important value is the memory allocation

Method Mean Error StdDev Allocated native memory Native memory leak Allocated
Thumbnail_ToSpan (NET 5) 58.68 ms 1.150 ms 1.889 ms 5,123,597 B - 120 B
PrimaryImage_ToSpan (NET 5) 2.981 s 0.0252 s 0.0236 s 222,028,216 B - 88 B
Thumbnail_ToSpan (NET 6) 47.54 ms 0.425 ms 0.398 ms 5,123,853 B - 600 B
PrimaryImage_ToSpan (NET 6) 2.968 s 0.0271 s 0.0241 s 222,029,080 B - 616 B
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

No branches or pull requests

1 participant