Skip to content

Add node10 to stree#6106

Merged
derekcollison merged 1 commit intomainfrom
neil/node10
Nov 11, 2024
Merged

Add node10 to stree#6106
derekcollison merged 1 commit intomainfrom
neil/node10

Conversation

@neilalexander
Copy link
Copy Markdown
Member

Although we probably don't want too many different node sizes here, the node10 case is particularly interesting because it perfectly fits the full 0-9 numeric range without wasting bytes. In fact it saves 96 bytes (208 bytes instead of 304) compared to using node16 for the same purpose.

This means memory savings for tracking subjects which are either mostly numerical throughout, or have tokens that are primarily numerical.

For a subject space that is mostly numerical, this can be several GBs less at the half-billion subjects mark and the saving can grow above that.

Signed-off-by: Neil Twigg neil@nats.io

Although we probably don't want too many different node sizes here, the
`node10` case is particularly interesting because it perfectly fits the
full 0-9 numeric range without wasting bytes. In fact it saves 96 bytes
(208 bytes instead of 304) compared to using `node16` for the same purpose.

This means memory savings for tracking subjects which are either mostly
numerical throughout, or have tokens that are primarily numerical.

For a subject space that is mostly numerical, this can be several GBs less
at the half-billion subjects mark and the saving can grow above that.

Signed-off-by: Neil Twigg <neil@nats.io>
@neilalexander neilalexander marked this pull request as ready for review November 11, 2024 16:24
@neilalexander neilalexander requested a review from a team as a code owner November 11, 2024 16:24
Copy link
Copy Markdown
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

LGTM

@derekcollison derekcollison merged commit 3827ef0 into main Nov 11, 2024
@derekcollison derekcollison deleted the neil/node10 branch November 11, 2024 17:24
neilalexander added a commit that referenced this pull request Nov 12, 2024
Includes the following:

* Some tweaks to the NRG test helpers
* #6055
* #6061
* #6065 
* #6041 (but with `math/rand`
instead of `math/rand/v2` due to an older Go version in CI for 2.10.x)
* #6066
* #6067
* #6069
* #6075
* #6082
* #6087
* #6086
* #6088
* #6089
* #6092
* #6096
* #6098
* #6097
* #6105
* #6104
* #6106
* #6109
* #6111
* #6112

Signed-off-by: Neil Twigg <neil@nats.io>
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.

2 participants