Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Presize MemoryStream when possible. #14529
Also use GetBuffer when we know we have presized the stream to the exact required size to prevent a needless copy.
Helps with #14178 by reducing allocations during loading (the main culprits are ZipFile and MixFile), decreasing the peak memory reached when loading. The other stuff is mostly just along for the ride. :)