clockworklabs / clockworklabs/SpacetimeDB

perf: Shrink `Table` by `Box`ing the `colliders` and `emptied_collider_slots` in `PointerMap`

Open
#2,083 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

This shaves off 40 bytes from PointerMap and in turn from Table.
Boxing here is not a problem as collisions are rare.

The perf impact of this hasn't been measured, but large types in general impose memcpys instead of using registers.
We should fix this once the more glaring issues have been resolved.

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

Locate the definitions of PointerMap and Table, then inspect the colliders and emptied_collider_slots fields and their uses. Compare the resulting type layout and verify that the intended 40-byte reduction is achieved without breaking collision handling; the issue notes that performance impact has not yet been measured.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
databases, performance
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.