clockworklabs / clockworklabs/SpacetimeDB

Cheap Static/Config data tables

Open
#5,192 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
Rust
Stars
25.2k
Forks
1.1k
Avg merge
2d 7h
Merged PRs (30d)
46

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by mapping how physics, terrain, or nav data is loaded and charged during a tick, then compare the const/static workaround with startup initialization; done should be a defined first-class read-only table path with near-free reads.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.