Skip to content

refactor(mmio): deduplicate code and avoid allocation#2319

Open
cagatay-y wants to merge 4 commits intohermit-os:mainfrom
cagatay-y:refactor-mmio
Open

refactor(mmio): deduplicate code and avoid allocation#2319
cagatay-y wants to merge 4 commits intohermit-os:mainfrom
cagatay-y:refactor-mmio

Conversation

@cagatay-y
Copy link
Contributor

@cagatay-y cagatay-y commented Mar 12, 2026

The third commit (e8a3932) in the series is meant as a demo for if enum_dispatch would work. The answer seems to be "no" as it requires a nightly feature and some trait boilerplate because of the lack of support for associated types in #[enum_dispatch(...)].

Copy link

@github-actions github-actions bot left a comment

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: 0c4b853 Previous: 7e57c74 Performance Ratio
startup_benchmark Build Time 88.14 s 83.75 s 1.05
startup_benchmark File Size 0.78 MB 0.78 MB 1.00
Startup Time - 1 core 0.97 s (±0.03 s) 0.91 s (±0.03 s) 1.06
Startup Time - 2 cores 0.99 s (±0.04 s) 0.93 s (±0.03 s) 1.07
Startup Time - 4 cores 0.98 s (±0.04 s) 0.92 s (±0.02 s) 1.06
multithreaded_benchmark Build Time 91.50 s 87.28 s 1.05
multithreaded_benchmark File Size 0.89 MB 0.89 MB 1.00
Multithreaded Pi Efficiency - 2 Threads 89.35 % (±9.52 %) 88.56 % (±8.29 %) 1.01
Multithreaded Pi Efficiency - 4 Threads 44.75 % (±3.81 %) 44.44 % (±3.38 %) 1.01
Multithreaded Pi Efficiency - 8 Threads 25.91 % (±2.63 %) 26.04 % (±1.60 %) 0.99
micro_benchmarks Build Time 94.18 s 94.35 s 1.00
micro_benchmarks File Size 0.90 MB 0.90 MB 1.00
Scheduling time - 1 thread 72.51 ticks (±5.50 ticks) 68.56 ticks (±3.95 ticks) 1.06
Scheduling time - 2 threads 40.07 ticks (±4.57 ticks) 36.94 ticks (±3.09 ticks) 1.08
Micro - Time for syscall (getpid) 3.06 ticks (±0.28 ticks) 2.91 ticks (±0.21 ticks) 1.05
Memcpy speed - (built_in) block size 4096 62729.01 MByte/s (±45039.81 MByte/s) 68337.85 MByte/s (±48614.32 MByte/s) 0.92
Memcpy speed - (built_in) block size 1048576 29266.45 MByte/s (±24319.25 MByte/s) 29909.96 MByte/s (±24828.21 MByte/s) 0.98
Memcpy speed - (built_in) block size 16777216 27780.94 MByte/s (±23145.56 MByte/s) 26591.72 MByte/s (±22262.44 MByte/s) 1.04
Memset speed - (built_in) block size 4096 63325.61 MByte/s (±45385.08 MByte/s) 69221.37 MByte/s (±49225.20 MByte/s) 0.91
Memset speed - (built_in) block size 1048576 29990.94 MByte/s (±24739.46 MByte/s) 30694.12 MByte/s (±25269.22 MByte/s) 0.98
Memset speed - (built_in) block size 16777216 28483.10 MByte/s (±23520.34 MByte/s) 27366.57 MByte/s (±22741.66 MByte/s) 1.04
Memcpy speed - (rust) block size 4096 58723.88 MByte/s (±42875.00 MByte/s) 61779.87 MByte/s (±45181.14 MByte/s) 0.95
Memcpy speed - (rust) block size 1048576 29291.29 MByte/s (±24321.21 MByte/s) 30501.92 MByte/s (±25259.37 MByte/s) 0.96
Memcpy speed - (rust) block size 16777216 27598.45 MByte/s (±22976.07 MByte/s) 25762.76 MByte/s (±21564.68 MByte/s) 1.07
Memset speed - (rust) block size 4096 59420.47 MByte/s (±43334.02 MByte/s) 62752.61 MByte/s (±45869.70 MByte/s) 0.95
Memset speed - (rust) block size 1048576 30062.10 MByte/s (±24752.39 MByte/s) 31320.98 MByte/s (±25725.03 MByte/s) 0.96
Memset speed - (rust) block size 16777216 28329.66 MByte/s (±23388.64 MByte/s) 26557.10 MByte/s (±22078.04 MByte/s) 1.07
alloc_benchmarks Build Time 92.38 s 88.56 s 1.04
alloc_benchmarks File Size 0.85 MB 0.85 MB 1.00
Allocations - Allocation success 100.00 % 100.00 % 1
Allocations - Deallocation success 100.00 % 100.00 % 1
Allocations - Pre-fail Allocations 100.00 % 100.00 % 1
Allocations - Average Allocation time 16407.41 Ticks (±287.32 Ticks) 12279.45 Ticks (±256.49 Ticks) 1.34
Allocations - Average Allocation time (no fail) 16407.41 Ticks (±287.32 Ticks) 12279.45 Ticks (±256.49 Ticks) 1.34
Allocations - Average Deallocation time 1265.46 Ticks (±1050.65 Ticks) 1161.59 Ticks (±793.94 Ticks) 1.09
mutex_benchmark Build Time 93.51 s 89.77 s 1.04
mutex_benchmark File Size 0.90 MB 0.90 MB 1.00
Mutex Stress Test Average Time per Iteration - 1 Threads 13.20 ns (±0.82 ns) 12.56 ns (±0.70 ns) 1.05
Mutex Stress Test Average Time per Iteration - 2 Threads 20.30 ns (±13.08 ns) 18.22 ns (±7.43 ns) 1.11

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

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