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

Issue841 remove file stream construction #2045

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

LoopedBard3
Copy link
Member

Initial testing for #841. Focused specifically on the ReadByte case to figure out the pattern we want to use before trying to apply it to all of the tests.

@LoopedBard3 LoopedBard3 self-assigned this Oct 1, 2021
@LoopedBard3 LoopedBard3 added this to the .NET7 MQ milestone Oct 1, 2021
@LoopedBard3
Copy link
Member Author

ReadByte Default Benchmark Statistics Before & After:
Before:

Method fileSize options Mean Error StdDev Median Min Max Allocated
ReadByte 1024 None 147.5 us 3.20 us 3.55 us 146.5 us 143.0 us 152.6 us 4 KB
ReadByte 1024 Asynchronous 153.8 us 2.64 us 2.71 us 153.8 us 149.9 us 159.0 us 4 KB

After:

Method fileSize options Mean Error StdDev Median Min Max Allocated
ReadByte 1024 None 1.793 us 0.0347 us 0.0356 us 1.780 us 1.742 us 1.877 us -
ReadByte 1024 Asynchronous 1.785 us 0.0220 us 0.0184 us 1.785 us 1.747 us 1.820 us -

I also ran the same code but with two 16kibibyte sized files to ensure that something else wasn't causing the super low times (like accidentally only reading one byte):

Method fileSize options Mean Error StdDev Median Min Max Allocated
ReadByte 1024 None 1.782 us 0.0216 us 0.0180 us 1.786 us 1.749 us 1.817 us -
ReadByte 1024 Asynchronous 2.050 us 0.0479 us 0.0551 us 2.039 us 1.981 us 2.182 us -
ReadByte 16384 None 36.135 us 0.4380 us 0.3657 us 36.118 us 35.392 us 36.692 us -
ReadByte 16384 Asynchronous 55.781 us 0.8563 us 0.8009 us 55.801 us 54.565 us 57.342 us 864 B

@LoopedBard3
Copy link
Member Author

@adamsitnik Going through some old issues in the perf repo and Bill mentioned your opinion on this change would be beneficial. What are your thoughts on using this general pattern for minimizing the creation of the FileStream during the tests? Thanks!

@LoopedBard3 LoopedBard3 removed this from the .NET7 MQ milestone Oct 14, 2021
@billwert
Copy link
Member

@adamsitnik ping

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.

None yet

2 participants