Skip to content

Conversation

byroot
Copy link
Member

@byroot byroot commented Sep 12, 2025

Same benchmark than in b6c472a / #55583

Since 1f8a0c0 had to be reverted as it changes the order of keys in the payload, the next bext thing we can do is to precompute the base hash.

The gain is modest but the patch is simple.

ruby 3.5.0dev (2025-08-27T10:41:07Z master 5257e1298c) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
aj-obj-serializer-template
                        23.500k i/100ms
Calculating -------------------------------------
aj-obj-serializer-template
                        234.683k (± 0.7%) i/s    (4.26 μs/i) -      1.175M in   5.007012s

Comparison:
aj-obj-serializer-template:   234682.8 i/s
     previous-commit:         223601.1 i/s - 1.05x  slower

Same benchmark than in b6c472a

Since 1f8a0c0 had to be reverted
as it changes the order of keys in the payload, the next bext thing
we can do is to precompute the base hash.

The gain is modest but the patch is simple.

```
ruby 3.5.0dev (2025-08-27T10:41:07Z master 5257e1298c) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
aj-obj-serializer-template
                        23.500k i/100ms
Calculating -------------------------------------
aj-obj-serializer-template
                        234.683k (± 0.7%) i/s    (4.26 μs/i) -      1.175M in   5.007012s

Comparison:
aj-obj-serializer-template:   234682.8 i/s
     previous-commit:         223601.1 i/s - 1.05x  slower
```
@rails-bot rails-bot bot added the activejob label Sep 12, 2025
@byroot byroot merged commit 4b494a5 into rails:main Sep 12, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant