Skip to content

Conversation

@hanazuki
Copy link
Collaborator

This patch modifies the AddressTranslation interface to accept source and destination buffers with explicit offsets, eliminating the need for intermediate buffer allocations at the caller side.

ruby 3.4.5 (2025-07-16 revision 20cda200d3) +YJIT +PRISM [x86_64-linux]
Warming up --------------------------------------
    main: UDP 6-to-4    32.584k i/100ms
Calculating -------------------------------------
    main: UDP 6-to-4    323.817k (± 1.8%) i/s    (3.09 μs/i) -      3.258M in  10.065832s

Comparison:
 patched: UDP 6-to-4:   365544.5 i/s
    main: UDP 6-to-4:   323816.7 i/s - 1.13x  slower

ruby 3.4.5 (2025-07-16 revision 20cda200d3) +YJIT +PRISM [x86_64-linux]
Warming up --------------------------------------
    main: UDP 4-to-6    51.787k i/100ms
Calculating -------------------------------------
    main: UDP 4-to-6    529.921k (± 1.1%) i/s    (1.89 μs/i) -      5.334M in  10.066969s

Comparison:
 patched: UDP 4-to-6:   577352.3 i/s
    main: UDP 4-to-6:   529920.7 i/s - 1.09x  slower

ruby 3.4.5 (2025-07-16 revision 20cda200d3) +YJIT +PRISM [x86_64-linux]
Warming up --------------------------------------
    main: TCP 6-to-4    34.825k i/100ms
Calculating -------------------------------------
    main: TCP 6-to-4    345.936k (± 2.5%) i/s    (2.89 μs/i) -      3.482M in  10.073507s

Comparison:
 patched: TCP 6-to-4:   358844.9 i/s
    main: TCP 6-to-4:   345935.5 i/s - same-ish: difference falls within error

ruby 3.4.5 (2025-07-16 revision 20cda200d3) +YJIT +PRISM [x86_64-linux]
Warming up --------------------------------------
    main: TCP 4-to-6    52.893k i/100ms
Calculating -------------------------------------
    main: TCP 4-to-6    533.078k (± 1.8%) i/s    (1.88 μs/i) -      5.342M in  10.024930s

Comparison:
 patched: TCP 4-to-6:   577846.9 i/s
    main: TCP 4-to-6:   533078.5 i/s - 1.08x  slower

ruby 3.4.5 (2025-07-16 revision 20cda200d3) +YJIT +PRISM [x86_64-linux]
Warming up --------------------------------------
main: ICMP echo 6-to-4
                        23.023k i/100ms
Calculating -------------------------------------
main: ICMP echo 6-to-4
                        229.563k (± 0.9%) i/s    (4.36 μs/i) -      2.302M in  10.029839s

Comparison:
patched: ICMP echo 6-to-4:   233499.0 i/s
main: ICMP echo 6-to-4:   229563.4 i/s - same-ish: difference falls within error

ruby 3.4.5 (2025-07-16 revision 20cda200d3) +YJIT +PRISM [x86_64-linux]
Warming up --------------------------------------
main: ICMP echo 4-to-6
                        28.870k i/100ms
Calculating -------------------------------------
main: ICMP echo 4-to-6
                        285.234k (± 1.9%) i/s    (3.51 μs/i) -      2.858M in  10.024055s

Comparison:
patched: ICMP echo 4-to-6:   300690.0 i/s
main: ICMP echo 4-to-6:   285234.3 i/s - 1.05x  slower

This patch modifies the AddressTranslation interface to accept source and
destination buffers with explicit offsets, eliminating the need for
intermediate buffer allocations at the caller side.
@hanazuki hanazuki merged commit fa62bfe into sorah:main Sep 11, 2025
1 check passed
@hanazuki hanazuki deleted the allocless-address-translator branch September 11, 2025 07:33
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