Commit 8c8e771
authored
Benchmark remote allocation (#22659)
# 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_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.1 parent f929d06 commit 8c8e771
File tree
2 files changed
+54
-1
lines changed- benches/benches/bevy_ecs/world
- crates/bevy_ecs/src/entity
2 files changed
+54
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
131 | 184 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
715 | 715 | | |
716 | 716 | | |
717 | 717 | | |
718 | | - | |
| 718 | + | |
719 | 719 | | |
720 | 720 | | |
721 | 721 | | |
| |||
0 commit comments