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

Improve disk IO speeds, optimize FAT Implementation memory allocation & speeds #2841

Merged
merged 15 commits into from
Dec 11, 2023

Conversation

GoldenretriverYT
Copy link
Contributor

@GoldenretriverYT GoldenretriverYT commented Dec 9, 2023

The current IO was heavily limited by the overhead added by IL2CPU.

My benchmark, which certainly shouldnt fall out this heavy due to sounding more like a write operation, creating as many files as possible within 30 seconds had following results:

Pre optimization: 9 files within 30 seconds created on Fat32 using File.Create
After: 73 files within 30 seconds created on Fat32 using File.Create

I also ran all the FAT Tests:
Pre: Took 157s
After: Took 45s

After added the fixes to reduce memory allocation, writing a 32kb file (using FileStream, not including the creation of the FileStream) had following results:
From 27586560 bytes to 102400 bytes. Not perfect, but certainly an improvement!

@GoldenretriverYT GoldenretriverYT changed the title Heavily improve IO read speeds Heavily improve IO read speeds & reduce memory allocation by file writes / reads Dec 10, 2023
@GoldenretriverYT GoldenretriverYT marked this pull request as draft December 10, 2023 00:52
@GoldenretriverYT
Copy link
Contributor Author

Draft for now cause I will look into speeding up writes too

@GoldenretriverYT
Copy link
Contributor Author

image
Even a 1mb file took 77s before (under my testing after patching the memory leaks)

@GoldenretriverYT GoldenretriverYT marked this pull request as ready for review December 10, 2023 19:52
@GoldenretriverYT GoldenretriverYT changed the title Heavily improve IO read speeds & reduce memory allocation by file writes / reads Improve disk IO speeds, optimize FAT Implementation memory allocation & speeds Dec 10, 2023
@valentinbreiz valentinbreiz self-requested a review December 11, 2023 08:53
Copy link
Member

@valentinbreiz valentinbreiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great optimizations thanks for this

@valentinbreiz valentinbreiz merged commit 26408ef into CosmosOS:master Dec 11, 2023
18 checks passed
@quajak
Copy link
Member

quajak commented Dec 11, 2023

Awesome work!

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.

5 participants