-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update WzBinaryReader - further speed improvements for large array wi…
…th ArrayPool Small Arrays (256 bytes): -Stackalloc and unsafe stackalloc are fastest (~117-119ns) -Regular byte[] arrays slightly slower (~129ns) -ArrayPool slightly slower still (~140ns) -Memory allocation: Only byte[] allocates heap memory (280B) Medium Arrays (1KB): -All methods perform similarly (~460-508ns) -Stackalloc and ArrayPool slightly faster than byte[] -Memory allocation: Only byte[] allocates heap memory (1048B) Large Arrays (1MB): -ArrayPool significantly outperforms byte[] (~465μs vs ~843μs) -byte[] causes significant GC pressure with Gen0/1/2 collections -Memory allocation: byte[] allocates ~1MB, ArrayPool minimal allocation Very Large Arrays (10MB): -ArrayPool maintains its advantage (~4.5ms vs ~6.3ms) -Even larger difference in memory pressure -byte[] allocates ~10MB and triggers GC collections -ArrayPool maintains minimal allocations prev improvement: b2ae668
- Loading branch information
1 parent
69370db
commit 5889a4b
Showing
2 changed files
with
185 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5889a4b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.