clockworklabs / clockworklabs/SpacetimeDB
C#/Unity SDK - `FrameTick`: spread out messages between frames
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 25.2k
- Forks
- 1.1k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 46
Description
Figure out some way to make it so that, if the client SDK receives e.g. 1000 messages in a single frame, we spread them out over the subsequent few frames, rather than blocking the main thread and dropping the frame rate. One possible way to implement this would be to give each call to FrameTick a TimeSpan budget, and then to break out of the loop if the total time spent processing during this call exceeds the budget. (This will not be a guarantee that any given call to FrameTick takes strictly less time than budget, but a best-effort to not exceed it by more than one full message.) The regular FrameTick method can probably have a hard-coded budget of, say, 10 ms (some number that's less than 1/60 of a second), but we should also provide an override that just takes the budget as an argument.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the C#/Unity SDK entry point for FrameTick and inspect how it processes queued messages per frame. Verify the current behavior with a workload such as 1000 messages, then define completion as spreading processing across subsequent frames while providing both the regular call and a budget-taking override without blocking the main thread beyond the requested best effort.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, unity
- Domain
- game-dev, performance
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100