Skip to content

refactor(net): remove mutex indirection to network device #1853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cagatay-y
Copy link
Contributor

@cagatay-y cagatay-y commented Jul 29, 2025

Let the network interface own the network device instead of accessing it through a static reference to a mutex.

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: b735657 Previous: 6578f2a Performance Ratio
startup_benchmark Build Time 91.17 s 78.08 s 1.17
startup_benchmark File Size 0.87 MB 0.87 MB 1.00
Startup Time - 1 core 0.95 s (±0.03 s) 0.83 s (±0.02 s) 1.15
Startup Time - 2 cores 0.97 s (±0.03 s) 0.84 s (±0.01 s) 1.15
Startup Time - 4 cores 0.99 s (±0.02 s) 0.84 s (±0.01 s) 1.18
multithreaded_benchmark Build Time 90.65 s 76.93 s 1.18
multithreaded_benchmark File Size 0.97 MB 0.97 MB 1.00

|

  • 2 Threads
    | 89.56 %
    (±7.62 %
    ) | 89.03 %
    (±6.93 %
    ) | 1.01 |
    |
  • 4 Threads
    | 44.22 %
    (±2.85 %
    ) | 43.14 %
    (±2.62 %
    ) | 1.03 |
    |
  • 8 Threads
    | 25.61 %
    (±1.83 %
    ) | 25.25 %
    (±1.49 %
    ) | 1.01 |
    | micro_benchmarks Build Time | 82.51 s | 97.59 s | 0.85 |
    | micro_benchmarks File Size | 0.98 MB | 0.98 MB | 1.00 |
    | Scheduling time
  • 1 thread
    | 55.77 ticks
    (±1.91 ticks
    ) | 66.85 ticks
    (±2.43 ticks
    ) | 0.83 |
    | Scheduling time
  • 2 threads
    | 32.78 ticks
    (±5.88 ticks
    ) | 37.44 ticks
    (±4.80 ticks
    ) | 0.88 |
    |
  • Time for syscall (getpid)
    | 13.87 ticks
    (±1.48 ticks
    ) | 15.30 ticks
    (±0.89 ticks
    ) | 0.91 |
    | Memcpy speed
  • (built_in) block size 4096
    | 82410.41 MByte/s
    (±57102.33 MByte/s
    ) | 73339.84 MByte/s
    (±50636.44 MByte/s
    ) | 1.12 |
    | Memcpy speed
  • (built_in) block size 1048576
    | 44135.93 MByte/s
    (±30501.33 MByte/s
    ) | 40839.42 MByte/s
    (±28364.76 MByte/s
    ) | 1.08 |
    | Memcpy speed
  • (built_in) block size 16777216
    | 29700.45 MByte/s
    (±24383.62 MByte/s
    ) | 27423.40 MByte/s
    (±22548.82 MByte/s
    ) | 1.08 |
    | Memset speed
  • (built_in) block size 4096
    | 82726.18 MByte/s
    (±57313.21 MByte/s
    ) | 73143.47 MByte/s
    (±50518.20 MByte/s
    ) | 1.13 |
    | Memset speed
  • (built_in) block size 1048576
    | 44344.40 MByte/s
    (±30641.53 MByte/s
    ) | 41090.30 MByte/s
    (±28537.31 MByte/s
    ) | 1.08 |
    | Memset speed
  • (built_in) block size 16777216
    | 30465.31 MByte/s
    (±24824.89 MByte/s
    ) | 28146.11 MByte/s
    (±22972.93 MByte/s
    ) | 1.08 |
    | Memcpy speed
  • (rust) block size 4096
    | 75718.41 MByte/s
    (±52814.03 MByte/s
    ) | 66370.03 MByte/s
    (±46085.85 MByte/s
    ) | 1.14 |
    | Memcpy speed
  • (rust) block size 1048576
    | 43952.31 MByte/s
    (±30399.01 MByte/s
    ) | 40843.98 MByte/s
    (±28354.19 MByte/s
    ) | 1.08 |
    | Memcpy speed
  • (rust) block size 16777216
    | 29810.60 MByte/s
    (±24482.58 MByte/s
    ) | 27304.99 MByte/s
    (±22419.20 MByte/s
    ) | 1.09 |
    | Memset speed
  • (rust) block size 4096
    | 75881.50 MByte/s
    (±52918.58 MByte/s
    ) | 66553.62 MByte/s
    (±46223.16 MByte/s
    ) | 1.14 |
    | Memset speed
  • (rust) block size 1048576
    | 44156.30 MByte/s
    (±30536.92 MByte/s
    ) | 41096.43 MByte/s
    (±28529.63 MByte/s
    ) | 1.07 |
    | Memset speed
  • (rust) block size 16777216
    | 30567.76 MByte/s
    (±24915.99 MByte/s
    ) | 28056.94 MByte/s
    (±22876.16 MByte/s
    ) | 1.09 |
    | alloc_benchmarks Build Time | 79.50 s | 94.07 s | 0.85 |
    | alloc_benchmarks File Size | 0.94 MB | 0.94 MB | 1.00 |
    |
  • Allocation success
    | 100.00 %
    | 100.00 %
    | 1 |
    |
  • Deallocation success
    | 69.96 %
    (±0.26 %
    ) | 70.03 %
    (±0.23 %
    ) | 1.00 |
    |
  • Pre-fail Allocations
    | 100.00 %
    | 100.00 %
    | 1 |
    |
  • Average Allocation time
    | 9653.26 Ticks
    (±323.05 Ticks
    ) | 10589.49 Ticks
    (±620.38 Ticks
    ) | 0.91 |
    |
  • Average Allocation time (no fail)
    | 9653.26 Ticks
    (±323.05 Ticks
    ) | 10589.49 Ticks
    (±620.38 Ticks
    ) | 0.91 |
    |
  • Average Deallocation time
    | 642.25 Ticks
    (±11.91 Ticks
    ) | 723.83 Ticks
    (±29.90 Ticks
    ) | 0.89 |
    | mutex_benchmark Build Time | 80.36 s | 97.19 s | 0.83 |
    | mutex_benchmark File Size | 0.98 MB | 0.98 MB | 1 |
    | Mutex Stress Test Average Time per Iteration
  • 1 Threads
    | 12.38 ns
    (±0.52 ns
    ) | 14.16 ns
    (±0.76 ns
    ) | 0.87 |
    | Mutex Stress Test Average Time per Iteration
  • 2 Threads
    | 14.58 ns
    (±1.12 ns
    ) | 16.64 ns
    (±1.52 ns
    ) | 0.88 |

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

@cagatay-y cagatay-y force-pushed the mutexless-network-device branch 2 times, most recently from d4bff3a to 7470bb6 Compare July 29, 2025 18:12
@mkroening mkroening self-assigned this Jul 29, 2025
@mkroening mkroening self-requested a review July 29, 2025 18:31
Let the network interface to own the network device instead of accessing it through a static reference to a mutex.
@cagatay-y cagatay-y force-pushed the mutexless-network-device branch from 7470bb6 to b735657 Compare July 30, 2025 13:39
@mkroening mkroening requested a review from Gelbpunkt August 5, 2025 13:09
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