Skip to content

Conversation

@Centril
Copy link
Contributor

@Centril Centril commented Feb 2, 2026

Description of Changes

The goal of this PR is to:

  • Make it easy to switch our backing implementation of identifiers, as seen in the commit changing to LeanString.
  • Improve type safety of our identifiers by having every identifier start with RawIdentifier and then Identifier is just a wrapper with validation on construction. TableName and ReducerName are then just wrappers around Identifier.
  • Reduce allocation in InstanceEnv by using the now clone-on-write O(1) + SSO optimized Identifier.
  • Reduce allocations in the query engine as a consequence of improving RawIdentifier and Identifier.
  • Have &'static str strings be further optimized by avoiding to allocate even for long ones. This is supported by impl From<&'static str> for RawIdentifier as well as switching to LeanString.

The PR results in a roughly 2k TPS improvement over master for WASM + hash indices. This should also help V8, as this is VM-agnostic.

API and ABI breaking changes

None

Expected complexity level and risk

3? Mostly just small changes in many places, but in a sea of small changes, mistakes can happen.

Testing

Covered by existing tests.

@Centril
Copy link
Contributor Author

Centril commented Feb 2, 2026

Next step after this PR and once websocket 2.0 has been merged is to also use the identifier types in the WS format to further reduce allocation.

@Centril Centril requested a review from gefjon February 2, 2026 16:22
Copy link
Collaborator

@bfops bfops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in my code-owned files LGTM

@Centril Centril force-pushed the centril/identifier-cleanup branch from 91cb2e1 to b9cf7b3 Compare February 3, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants