Remove uniform submap branching
Summary
Performance "Remove branching in submap accessors."
Purpose of change
See issue #70399
Describe the solution
Make uniform submaps point to a shared pre-filled submap, instead of having it be a special case. I'm not expecting any large performance changes from this alone, it's just easy to deliver in a PR separate from other tasks.
Describe alternatives you've considered
I did not change the get_items/get_fields non-const accessors since their behavior is somewhat odd, and has the potential to break things. They should be revisited (and removed) in a future PR.
Testing
All tests pass.
Additional context
Going to leave this sitting until everything else in that issue is done, since I'm not yet completely convinced it's worth the added complexity.
How much memory does this end up using? maptile_soa is not small, iirc.
How much memory does this end up using? maptile_soa is not small, iirc.
IIRC, when I looked it was essentially the cost of 4 additional submaps (air, rock, soil, and one other). Given the reality bubble is ~2.5k submaps, it shouldn't matter.
Uniform initialization is a nontrivial amount of time in memset as well during load. I will play with this and might ask to undraft this anyway.
Edit: eh, can't seem to pick it up anymore. Maybe other fixes when in which mitigated it (maybe it was happening too often before).
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.