Skip to content

Conversation

@fogti
Copy link
Contributor

@fogti fogti commented Nov 22, 2025

No description provided.

@fogti fogti changed the title Use less locking for romfs Use less locking for romfs, and some idiomacy fixes Nov 22, 2025
Copy link
Contributor

@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

Benchmark Current: 905b093 Previous: 1caea89 Performance Ratio
startup_benchmark Build Time 113.75 s 113.59 s 1.00
startup_benchmark File Size 0.87 MB 0.88 MB 1.00
Startup Time - 1 core 0.98 s (±0.03 s) 1.00 s (±0.02 s) 0.98
Startup Time - 2 cores 0.97 s (±0.03 s) 1.00 s (±0.03 s) 0.97
Startup Time - 4 cores 1.00 s (±0.03 s) 1.00 s (±0.03 s) 1.00
multithreaded_benchmark Build Time 116.15 s 112.31 s 1.03
multithreaded_benchmark File Size 0.97 MB 0.97 MB 1.00
Multithreaded Pi Efficiency - 2 Threads 87.66 % (±9.85 %) 91.87 % (±5.48 %) 0.95
Multithreaded Pi Efficiency - 4 Threads 42.95 % (±3.62 %) 45.62 % (±1.52 %) 0.94
Multithreaded Pi Efficiency - 8 Threads 24.62 % (±1.70 %) 26.92 % (±1.71 %) 0.91
micro_benchmarks Build Time 302.72 s 300.90 s 1.01
micro_benchmarks File Size 0.98 MB 0.98 MB 1.00
Scheduling time - 1 thread 178.07 ticks (±22.40 ticks) 188.89 ticks (±35.95 ticks) 0.94
Scheduling time - 2 threads 106.89 ticks (±20.93 ticks) 109.29 ticks (±17.74 ticks) 0.98
Micro - Time for syscall (getpid) 12.25 ticks (±7.22 ticks) 11.44 ticks (±6.11 ticks) 1.07
Memcpy speed - (built_in) block size 4096 56693.40 MByte/s (±42008.30 MByte/s) 58218.35 MByte/s (±41749.13 MByte/s) 0.97
Memcpy speed - (built_in) block size 1048576 13548.59 MByte/s (±11179.24 MByte/s) 13322.31 MByte/s (±11078.57 MByte/s) 1.02
Memcpy speed - (built_in) block size 16777216 8693.69 MByte/s (±7053.20 MByte/s) 9632.94 MByte/s (±7763.00 MByte/s) 0.90
Memset speed - (built_in) block size 4096 56846.04 MByte/s (±42112.77 MByte/s) 58627.12 MByte/s (±42001.83 MByte/s) 0.97
Memset speed - (built_in) block size 1048576 13883.76 MByte/s (±11369.29 MByte/s) 13664.11 MByte/s (±11297.52 MByte/s) 1.02
Memset speed - (built_in) block size 16777216 8870.74 MByte/s (±7151.43 MByte/s) 9828.35 MByte/s (±7867.40 MByte/s) 0.90
Memcpy speed - (rust) block size 4096 49003.02 MByte/s (±37540.62 MByte/s) 51942.01 MByte/s (±38359.80 MByte/s) 0.94
Memcpy speed - (rust) block size 1048576 13090.14 MByte/s (±10692.77 MByte/s) 12839.06 MByte/s (±10483.71 MByte/s) 1.02
Memcpy speed - (rust) block size 16777216 8937.15 MByte/s (±7275.69 MByte/s) 9531.71 MByte/s (±7678.70 MByte/s) 0.94
Memset speed - (rust) block size 4096 49957.20 MByte/s (±38225.46 MByte/s) 53011.14 MByte/s (±39115.85 MByte/s) 0.94
Memset speed - (rust) block size 1048576 13450.00 MByte/s (±10910.67 MByte/s) 13244.14 MByte/s (±10750.32 MByte/s) 1.02
Memset speed - (rust) block size 16777216 9152.74 MByte/s (±7404.77 MByte/s) 9722.67 MByte/s (±7778.13 MByte/s) 0.94
alloc_benchmarks Build Time 317.84 s 302.31 s 1.05
alloc_benchmarks File Size 0.94 MB 0.95 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 17995.50 Ticks (±879.50 Ticks) 26215.84 Ticks (±1230.11 Ticks) 0.69
Allocations - Average Allocation time (no fail) 17995.50 Ticks (±879.50 Ticks) 26215.84 Ticks (±1230.11 Ticks) 0.69
Allocations - Average Deallocation time 2805.12 Ticks (±823.86 Ticks) 3319.78 Ticks (±1756.11 Ticks) 0.84
mutex_benchmark Build Time 296.39 s 301.33 s 0.98
mutex_benchmark File Size 0.97 MB 0.98 MB 1.00
Mutex Stress Test Average Time per Iteration - 1 Threads 38.16 ns (±3.32 ns) 38.48 ns (±4.89 ns) 0.99
Mutex Stress Test Average Time per Iteration - 2 Threads 30.92 ns (±2.74 ns) 31.68 ns (±3.36 ns) 0.98

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

@mkroening mkroening self-assigned this Nov 22, 2025
@fogti fogti force-pushed the romfs-less-locking branch 2 times, most recently from 2e98e02 to ee5c9c8 Compare November 29, 2025 15:08
@fogti fogti changed the title Use less locking for romfs, and some idiomacy fixes Use less locking for romfs Nov 30, 2025
@fogti fogti force-pushed the romfs-less-locking branch from ee5c9c8 to 15149dc Compare November 30, 2025 20:12
Copy link
Member

@mkroening mkroening left a comment

Choose a reason for hiding this comment

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

Sorry for the wait! :)

I will move the lock to the outside soonish (hopefully), but for now this is fine. Thanks! 👍

@mkroening mkroening changed the title Use less locking for romfs refactor(fs/mem): move RomFileInner's RwLock into it Dec 5, 2025
@fogti
Copy link
Contributor Author

fogti commented Dec 5, 2025

Given that there can be multiple references to the same ram/romfile, one can't easily get rid of the inner locks (unless one wants to take a lock on all in-memory files). But one could get rid of the position Mutex<usize>.

@mkroening mkroening added this pull request to the merge queue Dec 5, 2025
@mkroening
Copy link
Member

Given that there can be multiple references to the same ram/romfile, one can't easily get rid of the inner locks (unless one wants to take a lock on all in-memory files). But one could get rid of the position Mutex<usize>.

True. Even better, then.

Merged via the queue into hermit-os:main with commit 3448d37 Dec 5, 2025
19 checks passed
@fogti fogti deleted the romfs-less-locking branch December 6, 2025 16:15
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