Skip to content

Cow-ify ActionMeta #806

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: master
Choose a base branch
from
Open

Cow-ify ActionMeta #806

wants to merge 1 commit into from

Conversation

FelixMcFelix
Copy link
Collaborator

Mooves ActionMeta from a String->String map to something capable of holding &'static strs as both keys and values. This only really affects slowpath traffic, but this leads to fewer allocations when traversing that path.

Split out of #805, where this wasn't a necessary part of the fix.

Mooves `ActionMeta` from a `String`->`String` map to something capable
of holding `&'static str`s as both keys and values. This only really
affects slowpath traffic, but this leads to fewer allocations when
traversing that path.

Split out of #805, where this wasn't a necessary part of the fix.
@FelixMcFelix FelixMcFelix added perf cleanup Code cleanliness labels Jul 23, 2025
@FelixMcFelix
Copy link
Collaborator Author

Roughly demonstrating the impact via cargo ubench:

kyle@KyleOxide opte % cargo ubench V4-Tcp-OUT-1400B
   Compiling opte v0.1.0 (/Users/kyle/gits/opte/lib/opte)
   Compiling oxide-vpc v0.1.0 (/Users/kyle/gits/opte/lib/oxide-vpc)
   Compiling opte-test-utils v0.1.0 (/Users/kyle/gits/opte/lib/opte-test-utils)
   Compiling opte-bench v0.1.0 (/Users/kyle/gits/opte/bench)
    Finished `release-lto` profile [optimized + debuginfo] target(s) in 44.04s
     Running benches/userland.rs (target/release-lto/deps/userland-49b68a123c6927a2)
parse/ULP-FastPath/wallclock/V4-Tcp-OUT-1400B
                        time:   [44.552 ns 45.245 ns 45.835 ns]
                        change: [−0.9153% +1.0190% +2.8656%] (p = 0.30 > 0.05)
                        No change in performance detected.
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild

process/ULP-FastPath/wallclock/V4-Tcp-OUT-1400B
                        time:   [164.34 ns 165.54 ns 167.63 ns]
                        change: [−2.5020% −1.3224% −0.2918%] (p = 0.01 < 0.05)
                        Change within noise threshold.
Found 5 outliers among 100 measurements (5.00%)
  1 (1.00%) high mild
  4 (4.00%) high severe

parse/ULP-SlowPath/wallclock/V4-Tcp-OUT-1400B
                        time:   [44.168 ns 44.898 ns 45.498 ns]
                        change: [−2.1795% −0.2915% +1.6479%] (p = 0.77 > 0.05)
                        No change in performance detected.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high severe

process/ULP-SlowPath/wallclock/V4-Tcp-OUT-1400B
                        time:   [192.16 ns 193.71 ns 195.68 ns]
                        change: [−32.299% −15.558% +4.0681%] (p = 0.16 > 0.05)
                        No change in performance detected.
Found 14 outliers among 100 measurements (14.00%)
  5 (5.00%) high mild
  9 (9.00%) high severe

process/ULP-FastPath/alloc_ct/V4-Tcp-OUT-1400B
                        time:   [3.0000  3.0000  3.0000 ]
                        change: [+0.0000% +0.0000% +0.0000%] (p = NaN > 0.05)
                        No change in performance detected.

process/ULP-SlowPath/alloc_ct/V4-Tcp-OUT-1400B
                        time:   [35.000  35.000  35.000 ]
                        change: [−18.605% −18.605% −18.605%] (p = 0.00 < 0.05)
                        Performance has improved.

process/ULP-FastPath/alloc_sz/V4-Tcp-OUT-1400B
                        time:   [264.00 B 264.00 B 264.00 B]
                        change: [+0.0000% +0.0000% +0.0000%] (p = NaN > 0.05)
                        No change in performance detected.

process/ULP-SlowPath/alloc_sz/V4-Tcp-OUT-1400B
                        time:   [6635.0 B 6635.0 B 6635.0 B]
                        change: [−1.1177% −1.1177% −1.1177%] (p = 0.00 < 0.05)
                        Performance has improved.

The baseline slowpath counts are 43 allocs and 6710B.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code cleanliness perf
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant