Skip to content

speed up BIOS bootloader#550

Merged
Freax13 merged 2 commits intomainfrom
enhancement/bios-disk-speed
Mar 18, 2026
Merged

speed up BIOS bootloader#550
Freax13 merged 2 commits intomainfrom
enhancement/bios-disk-speed

Conversation

@Freax13
Copy link
Member

@Freax13 Freax13 commented Mar 18, 2026

This PR speeds up the BIOS bootloader by reducing the number of disk read operations. See commits for details.

This reduces the runtime of the large_ramdisk test (with KVM enabled) from ~35s to ~9s.

Closes #549

Freax13 added 2 commits March 18, 2026 07:51
Doing many small reads is much slower than doing fewer large reads.
Let's try to read several clusters at once if they're contiguous.
read_exact_at is often called with a bunch of offsets in the same
general area. In a lot of cases, the data needed is still in the
buffer from the last call. Let's make use of that by remembering the
last sector read and skip reading the same sector again.
@Freax13
Copy link
Member Author

Freax13 commented Mar 18, 2026

@NikoPit please check if that resolves your issue.

Copy link
Member

@phil-opp phil-opp left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

@NikoPit
Copy link

NikoPit commented Mar 18, 2026

yup it significently sped up the boot time, thanks

@NikoPit
Copy link

NikoPit commented Mar 18, 2026

tho its still pretty slow, but this definitely made it a lot more better

@NikoPit
Copy link

NikoPit commented Mar 18, 2026

btw completely off topic, is there a discord server specificly for this?

@Freax13 Freax13 merged commit 48b9311 into main Mar 18, 2026
18 checks passed
@Freax13
Copy link
Member Author

Freax13 commented Mar 18, 2026

tho its still pretty slow, but this definitely made it a lot more better

It's about as fast as the UEFI implementation. I think at some point you just have to accept that loading large files is going to take some time 😅

btw completely off topic, is there a discord server specificly for this?

No, but there's a Zulip.

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.

Loading the ramdisk takes an insanely long time

3 participants