Skip to content

refactor: move runtime code to crate::rt - #2601

Merged
mkroening merged 6 commits into
mainfrom
rt
Aug 4, 2026
Merged

refactor: move runtime code to crate::rt#2601
mkroening merged 6 commits into
mainfrom
rt

Conversation

@mkroening

Copy link
Copy Markdown
Member

Private imports at the crate root are visible to any children. This leads rust-analyzer to import crate::arch::kernel from crate::kernel by default.

This PR moves all functions from crate (lib.rs) to crate::rt (rt.rs) to avoid any unwanted private reexports from the crate root.

@mkroening mkroening self-assigned this Aug 3, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Benchmark Results

Details
Benchmark Current: 1322a61 Previous: 2e23902 Performance Ratio
startup_benchmark Build Time 84.60 s 80.34 s 1.05
startup_benchmark File Size 0.76 MB 0.80 MB 0.96
Startup Time - 1 core 0.75 s (±0.02 s) 0.75 s (±0.02 s) 1.00
Startup Time - 2 cores 0.77 s (±0.02 s) 0.74 s (±0.02 s) 1.04
Startup Time - 4 cores 0.77 s (±0.02 s) 0.74 s (±0.02 s) 1.04
multithreaded_benchmark Build Time 80.40 s 82.11 s 0.98
multithreaded_benchmark File Size 0.87 MB 0.86 MB 1.02
Multithreaded Pi Efficiency - 2 Threads 90.15 % (±7.34 %) 85.89 % (±6.61 %) 1.05
Multithreaded Pi Efficiency - 4 Threads 44.72 % (±2.34 %) 43.43 % (±2.56 %) 1.03
Multithreaded Pi Efficiency - 8 Threads 25.74 % (±1.45 %) 25.76 % (±1.53 %) 1.00
micro_benchmarks Build Time 77.52 s 80.40 s 0.96
micro_benchmarks File Size 0.88 MB 0.86 MB 1.02
Scheduling time - 1 thread 64.54 ticks (±2.69 ticks) 62.65 ticks (±4.06 ticks) 1.03
Scheduling time - 2 threads 35.79 ticks (±4.07 ticks) 34.08 ticks (±4.10 ticks) 1.05
Micro - Time for syscall (getpid) 4.34 ticks (±0.87 ticks) 3.45 ticks (±0.58 ticks) 1.26
Memcpy speed - (built_in) block size 4096 84792.21 MByte/s (±58530.66 MByte/s) 82448.38 MByte/s (±56997.13 MByte/s) 1.03
Memcpy speed - (built_in) block size 1048576 30589.70 MByte/s (±24698.58 MByte/s) 30585.98 MByte/s (±24707.84 MByte/s) 1.00
Memcpy speed - (built_in) block size 16777216 29440.76 MByte/s (±24206.30 MByte/s) 26340.06 MByte/s (±21720.96 MByte/s) 1.12
Memset speed - (built_in) block size 4096 84871.23 MByte/s (±58588.01 MByte/s) 82292.76 MByte/s (±56891.50 MByte/s) 1.03
Memset speed - (built_in) block size 1048576 31325.40 MByte/s (±25132.27 MByte/s) 31323.85 MByte/s (±25145.86 MByte/s) 1.00
Memset speed - (built_in) block size 16777216 30201.30 MByte/s (±24643.15 MByte/s) 27104.68 MByte/s (±22209.94 MByte/s) 1.11
Memcpy speed - (rust) block size 4096 76059.26 MByte/s (±53003.67 MByte/s) 74097.96 MByte/s (±51811.44 MByte/s) 1.03
Memcpy speed - (rust) block size 1048576 30341.68 MByte/s (±24511.03 MByte/s) 30361.60 MByte/s (±24602.37 MByte/s) 1.00
Memcpy speed - (rust) block size 16777216 29423.72 MByte/s (±24187.64 MByte/s) 27625.34 MByte/s (±22806.88 MByte/s) 1.07
Memset speed - (rust) block size 4096 76600.38 MByte/s (±53388.20 MByte/s) 74373.47 MByte/s (±51976.48 MByte/s) 1.03
Memset speed - (rust) block size 1048576 31073.04 MByte/s (±24957.75 MByte/s) 31110.89 MByte/s (±25033.24 MByte/s) 1.00
Memset speed - (rust) block size 16777216 30187.65 MByte/s (±24625.62 MByte/s) 28386.93 MByte/s (±23265.03 MByte/s) 1.06
alloc_benchmarks Build Time 77.32 s 74.76 s 1.03
alloc_benchmarks File Size 0.84 MB 0.87 MB 0.96
Allocations - Allocation success 91.34 % 91.31 % 1.00
Allocations - Deallocation success 100.00 % 100.00 % 1
Allocations - Pre-fail Allocations 61.54 % 61.44 % 1.00
Allocations - Average Allocation time 4260.72 Ticks (±123.88 Ticks) 5860.58 Ticks (±98.43 Ticks) 0.73
Allocations - Average Allocation time (no fail) 5061.38 Ticks (±131.76 Ticks) 6554.81 Ticks (±92.86 Ticks) 0.77
Allocations - Average Deallocation time 991.15 Ticks (±237.59 Ticks) 1805.01 Ticks (±250.35 Ticks) 0.55
mutex_benchmark Build Time 76.37 s 79.82 s 0.96
mutex_benchmark File Size 0.88 MB 0.86 MB 1.02
Mutex Stress Test Average Time per Iteration - 1 Threads 12.18 ns (±0.48 ns) 12.10 ns (±0.41 ns) 1.01
Mutex Stress Test Average Time per Iteration - 2 Threads 39.66 ns (±2.29 ns) 40.26 ns (±1.68 ns) 0.99

This comment was automatically generated by workflow using github-action-benchmark.

@mkroening
mkroening force-pushed the rt branch 4 times, most recently from 0931491 to 80497fd Compare August 3, 2026 16:27
@mkroening
mkroening enabled auto-merge August 4, 2026 07:34
@mkroening
mkroening added this pull request to the merge queue Aug 4, 2026
Merged via the queue into main with commit cc2f4ea Aug 4, 2026
21 checks passed
@mkroening
mkroening deleted the rt branch August 4, 2026 08:17
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.

1 participant