Benchmark remote allocation#22659
Merged
alice-i-cecile merged 1 commit intobevyengine:mainfrom Feb 2, 2026
Merged
Conversation
BD103
approved these changes
Feb 2, 2026
Member
BD103
left a comment
There was a problem hiding this comment.
Implementation looks good and tested locally!
viridia
pushed a commit
to viridia/bevy
that referenced
this pull request
Feb 3, 2026
# Objective After bevyengine#18670, we have a `RemoteAllocator`, but we don't have benchmarks for it compared to the non-remote allocator. This PR just adds those benchmarks. I don't know if we actually want these benchmarks, but it seems reasonable to have, and it took no time to make, so I figured I'd put it out there. ## Solution Add `entity_allocator_allocate_fresh_remote` and `entity_allocator_allocate_reused_remote` benchmark groups. ## Testing - CI, benchmarks --- ## Showcase ```txt entity_allocator_allocate_fresh/10000_entities 1.00 22.8±0.29µs ? ?/sec entity_allocator_allocate_fresh/100_entities 1.00 227.9±6.37ns ? ?/sec entity_allocator_allocate_fresh/1_entities 1.00 6.2±3.83ns ? ?/sec entity_allocator_allocate_fresh_bulk/10000_entities 1.00 19.9±0.25µs ? ?/sec entity_allocator_allocate_fresh_bulk/100_entities 1.00 227.5±6.95ns ? ?/sec entity_allocator_allocate_fresh_bulk/1_entities 1.00 11.5±4.69ns ? ?/sec entity_allocator_allocate_fresh_remote/10000_entities 1.00 19.4±0.32µs ? ?/sec entity_allocator_allocate_fresh_remote/100_entities 1.00 174.2±3.63ns ? ?/sec entity_allocator_allocate_fresh_remote/1_entities 1.00 3.5±3.02ns ? ?/sec entity_allocator_allocate_reused/10000_entities 1.00 21.5±0.37µs ? ?/sec entity_allocator_allocate_reused/100_entities 1.00 233.3±11.77ns ? ?/sec entity_allocator_allocate_reused/1_entities 1.00 8.3±3.70ns ? ?/sec entity_allocator_allocate_reused_bulk/10000_entities 1.00 20.4±0.64µs ? ?/sec entity_allocator_allocate_reused_bulk/100_entities 1.00 261.5±45.59ns ? ?/sec entity_allocator_allocate_reused_bulk/1_entities 1.00 19.7±10.77ns ? ?/sec entity_allocator_allocate_reused_remote/10000_entities 1.00 77.9±1.53µs ? ?/sec entity_allocator_allocate_reused_remote/100_entities 1.00 774.9±16.28ns ? ?/sec entity_allocator_allocate_reused_remote/1_entities 1.00 7.3±3.60ns ? ?/sec ``` Long story short, remote allocation is a little over 3 times slower than non-remote. All things considered, I think that's pretty good.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
After #18670, we have a
RemoteAllocator, but we don't have benchmarks for it compared to the non-remote allocator. This PR just adds those benchmarks.I don't know if we actually want these benchmarks, but it seems reasonable to have, and it took no time to make, so I figured I'd put it out there.
Solution
Add
entity_allocator_allocate_fresh_remoteandentity_allocator_allocate_reused_remotebenchmark groups.Testing
Showcase
Long story short, remote allocation is a little over 3 times slower than non-remote. All things considered, I think that's pretty good.