Repository navigation
Store seshat:field_specs/0 in persistent terms - #202
Merged
Merged
Conversation
Collaborator
Author
|
Testing this on RabbitMQ main with 2000 streams:
Persistent term field specs: |
the-mikedavis
force-pushed
the
md/pt-field-specs
branch
from
December 18, 2025 22:40
f34d066 to
c53cddd
Compare
Previously each writer, replica reader and replica stored their field
spec in seshat, so the ETS group table in seshat contained many
duplicate field spec values. Seshat accepts `{persistent_term, term()}`
for field specs to avoid this duplication. We can update osiris_writer,
osiris_replica_reader and osiris_reader to eagerly create those
persistent terms with their field specs and avoid the duplication in
ETS. This saves a significant amount of memory consumed by the ETS table
and also saves time and garbage when querying the ETS table, for
example when building the counters map with `seshat:counters(osiris)`.
the-mikedavis
force-pushed
the
md/pt-field-specs
branch
from
December 18, 2025 22:42
c53cddd to
a868b5b
Compare
Contributor
|
So, a β 38.5% percent speedup for |
michaelklishin
approved these changes
Dec 18, 2025
Contributor
There was a problem hiding this comment.
Note that besides a 38% execution time gain and a 90+% ETS table memory footprint gain (on isolated benchmarks), this practice is already used in Ra for its counters https://github.com/rabbitmq/ra/blob/main/src/ra_counters.erl#L28.
Contributor
|
@the-mikedavis thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously each writer, replica reader and replica stored their field spec in seshat, so the ETS group table in seshat contained many duplicate field spec values. Seshat accepts
{persistent_term, term()}for field specs to avoid this duplication. We can update osiris_writer, osiris_replica_reader and osiris_reader to eagerly create those persistent terms with their field specs and avoid the duplication in ETS. This saves a significant amount of memory consumed by the ETS table and also saves time and garbage when querying the ETS table, for example when building the counters map withseshat:counters(osiris).