Skip to content

Cheap Static/Config data tables #5192

@website-features

Description

@website-features

Right now it is reasonably expensive to load in physics, terrain, or nav data during a "tick" which is the hottest path. Ideally we have some first-class support for a cheap read-only table that can be initialized at startup. Right now there is the potential to use a const or static but with caveats so having the team support this pattern out of the box would be really valuable.

For example, I have navmesh grid data that is ~8mb. I need to load in ~200 bytes * 9 (for the chunks surround) per moving entity. So if I have 100 players and maybe 1000 monsters running around thats 1,1002009 potentially bytes read every ~100ms when I never need to edit this data.

I can simply add this data into a const and bundle it with the module but it doesn't feel like "the spacetimedb way" of doing things. If something is 100% read only I'd like a way to read that data for close to free instead of the charge at the same rate as hot data.

Requested by @onx2 via the SpacetimeDB site.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions