Comments (3)
As I see it, there are two options: (please correct me if I'm wrong, I'm writing this without much experience in the storage system)
Option 1
- Split
BlobVec
intoRawBlobVec
andBlobVec
(likeVec
's implementation) - Use
RawBlobVec
andRawVec
inColumn
- Use a single length value for all columns in
Table
This will reduce 3*columns - 1usize
s from eachTable
(8[4]*(3*columns-1) bytes), not too shabby.
Option 2
Similar to option 1, but instead of RawVec
s, Column
will just store (small abstractions over) raw pointers.
Capacity and length will be stored at the Table
level.
This will reduce 6*columns - 2 usize
s from each Table
(8[4]*(6*columns-2) bytes), twice as much as option 1.
from bevy.
Option 2 would be strongly preferred, though some other paths might need to be retained to keep support ComponentSparseSet, intact.
Bikeshedding here, but a RawBlobVec
is just a Blob
.
One thing to note is that the capacity of BlobVec
is set to usize::MAX
for ZSTs, which may not play well with this setup.
bevy_ptr
has the concept of a ThinSlicePtr<'a, T>
which is a NonNull
that becomes a slice in debug builds. We may want to use a ThinVec<T>
of the same nature to handle the component ticks in Column
.
from bevy.
Now that I think about it, option 2 would save a lot branching - it's a must.
This does make me wonder if the ZSTs should be stored separately, maybe one SparseSet
for ZSTs, and one for normal ones (eg):
struct Table {
columns: ImmutableSparseSet<ComponentId, Column<false>>,
zst_columns: ImmutableSparseSet<ComponentId, Column<true>>,
cap: usize,
len: usize
entities: Vec<Entity>,
}
// ..
struct Column<const IS_ZST: bool> { .. }
from bevy.
Related Issues (20)
- Add `LoadContext::load_direct_with_settings` or similar
- multi-threaded feature name is kebab case but all others are snake case HOT 4
- Create an example showcasing disjoint mutable access to the world via `unsafe_world_cell` HOT 2
- Remove unecessary lint
- Main branch fails to compile on Rust beta. HOT 1
- Bevy, on Web and WebGL, doesn't exit winit's Event Loop cleanly after a GPU crash. It panics twice with already borrowed: BorrowMutError HOT 9
- Panic on `Transform::local_?` calls HOT 7
- Bevy's bundle types should implement Clone where possible
- Reflect derive with generic trait bounds HOT 2
- Remake #12938 targeting `main` HOT 1
- GLTF with 3 UV Maps throws an error
- `Mesh2dHandle` should have `clone_weak` and similar methods implemented
- Make Bevy Citable HOT 4
- Indic font rendering incorrectly HOT 1
- Allow usage of `Rg11b10Float` for HDR
- Add `ExitCode` to `AppExit`
- Clarify camera coordinate system further
- Clarify how `Plane3d` is oriented in space HOT 6
- Errors when loading labled assets
- Clippy complains when building with wasm32.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bevy.