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

Speed up write performance #382

Merged
merged 2 commits into from
Nov 12, 2023
Merged

Speed up write performance #382

merged 2 commits into from
Nov 12, 2023

Conversation

harrowm
Copy link
Collaborator

@harrowm harrowm commented Nov 7, 2023

While using the r68k tool to test writing files, I noticed that the write performance of writing a new file is very bad. On a 64Gb image, 'write test" takes about 3 seconds on my machine (a M1 Air) if the file test exists, but about 170 seconds if it does not.

By logging the reads/write in r68k, it's possible to see that if the file exists r68k has to do 1,086 sector reads and 1,024 sector writes but if the file does not exist then r68k does 296,134 reads and 9,227 writes.

The cause of this is that the fat library we use doesn't use the FS_HINTS sector when allocating new entry in the fat table. This PR changes the fat_io library to use the "next free cluster" hint.

Doing this reduces the reads/writes to write a new test file to 4,114 and 11,662. This speeds up execution from 172 seconds before the change to about 3.75 seconds.

I have only tested this change under r68k, not a real rosco board.

Copy link
Collaborator

@roscopeco roscopeco left a comment

Choose a reason for hiding this comment

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

Looks good, and seems okay on hardware. Thanks 👍

@harrowm harrowm merged commit e0bcac9 into develop Nov 12, 2023
1 check passed
@harrowm harrowm deleted the 68k_log_io branch November 12, 2023 14:28
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.

2 participants