Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ ovmf-prebuilt = "0.2.4"
[build-dependencies]
kernel = { path = "kernel", artifact = "bin", target = "x86_64-unknown-none" }
bootloader = "0.11.17"

[profile.release]
opt-level = 3
lto = "thin"
codegen-units = 1
48 changes: 48 additions & 0 deletions docs/performance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Performance validation

Rustalis is an experimental OS, so performance changes should be measured rather
than assumed. The release profile in the workspace enables maximum optimization,
thin link-time optimization, and a single codegen unit. These settings affect
release builds; ordinary development builds remain optimized for iteration speed.

## Build

Use the pinned nightly toolchain from `rust-toolchain.toml`:

```sh
cargo build --release
```

For correctness checks, continue to run:

```sh
cargo fmt --all -- --check
cargo check --workspace
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace
```

## Benchmark protocol

Before claiming a speedup, record a baseline and compare it with the optimized
build on the same host and QEMU configuration.

Record at least:

- Build mode and Rust toolchain version.
- Kernel/boot-image size.
- Time from QEMU launch to the first serial boot message.
- Repeated measurements (at least five runs), reporting median and spread.
- QEMU version, machine type, firmware, CPU settings, and host OS.

Keep the guest workload and emulator arguments identical between runs. Separate
build-time improvements from boot-time and runtime improvements; they measure
different things. Do not treat a smaller binary or a faster host build as proof
of faster kernel execution.

## Next optimization targets

Once the corresponding subsystems exist, benchmark serial logging overhead,
page allocation, context switching, syscall entry/exit, and filesystem/network
I/O independently. Avoid removing diagnostics or weakening safety checks solely
to improve a benchmark. Keep debug builds useful for kernel development.
Loading