You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@datasketches.apache.org by "tisonkun (via GitHub)" <gi...@apache.org> on 2026/08/11 01:34:35 UTC
[I] Define deep estimated-size accounting for generic sketch values (datasketches-rust)
tisonkun opened a new issue, #193:
URL: https://github.com/apache/datasketches-rust/issues/193
The existing estimated_size methods account for inline state and heap capacity directly owned by sketch implementations. For generic values, however, they cannot see heap allocations owned by the value itself.
The clearest example is CompactTupleSketch<S>: Vec<TupleEntry<S>> capacity includes the inline S value, but a summary such as String or Vec<f64> may retain arbitrary additional heap memory. Similar questions apply to generic Tuple operator state and, potentially, generic items in Frequencies.
One possible direction is a public EstimatedSize trait implemented by built-in value types and implementable by user summaries. Before choosing it, we should define:
- whether estimated_size is shallow or deep;
- whether size_of::<Self>() is included or only heap allocations;
- whether vector length or retained capacity is counted;
- how shared allocations are handled without double counting;
- whether allocator overhead is intentionally excluded;
- how methods remain available for generic types that do not implement the trait;
- whether a callback or an estimated_size_with method composes better than another public trait;
- whether serialization size and resident memory remain clearly separate concepts.
Related work: #135, #137, #174, and #177.
cc @Renkai @ariesdevil @tabac @notfilippo — you contributed to or reviewed the existing estimated-size work; input on a stable accounting contract would be valuable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@datasketches.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@datasketches.apache.org
For additional commands, e-mail: dev-help@datasketches.apache.org
Re: [I] Define deep estimated-size accounting for generic sketch values (datasketches-rust)
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on issue #193:
URL: https://github.com/apache/datasketches-rust/issues/193#issuecomment-5305395022
@Renkai I think we care more about the memory footprint rather than serialization here.
So perhaps a as exact as possible size the sketch occupies memory (the heap).
In this direction, we may not include data on stack, and we'd prefer container's capacity rather than its logical size.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@datasketches.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@datasketches.apache.org
For additional commands, e-mail: dev-help@datasketches.apache.org
Re: [I] Define deep estimated-size accounting for generic sketch values (datasketches-rust)
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on issue #193:
URL: https://github.com/apache/datasketches-rust/issues/193#issuecomment-5248356853
I think the method's name itself, "Estimated Size," means a certain degree of deviation is acceptable.
However, we should probably have a contract to evaluate exactly what it estimates; otherwise, if there's a large deviation, I think such an interface might be unnecessary.
Of course, we might not need to implement an estimated_size method for all sketches; this is an open issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@datasketches.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@datasketches.apache.org
For additional commands, e-mail: dev-help@datasketches.apache.org
Re: [I] Define deep estimated-size accounting for generic sketch values (datasketches-rust)
Posted by "Renkai (via GitHub)" <gi...@apache.org>.
Renkai commented on issue #193:
URL: https://github.com/apache/datasketches-rust/issues/193#issuecomment-5305347253
The estimated size shall be a **tight upper bound**, not just **deviation**, which means return more than serialized size is acceptable, but we don't want less, is that right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@datasketches.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@datasketches.apache.org
For additional commands, e-mail: dev-help@datasketches.apache.org
Re: [I] Define deep estimated-size accounting for generic sketch values (datasketches-rust)
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on issue #193:
URL: https://github.com/apache/datasketches-rust/issues/193#issuecomment-6520730993
This should be resolved by #302 now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@datasketches.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@datasketches.apache.org
For additional commands, e-mail: dev-help@datasketches.apache.org
Re: [I] Define deep estimated-size accounting for generic sketch values (datasketches-rust)
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun closed issue #193: Define deep estimated-size accounting for generic sketch values
URL: https://github.com/apache/datasketches-rust/issues/193
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@datasketches.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@datasketches.apache.org
For additional commands, e-mail: dev-help@datasketches.apache.org
Re: [I] Define deep estimated-size accounting for generic sketch values (datasketches-rust)
Posted by "ariesdevil (via GitHub)" <gi...@apache.org>.
ariesdevil commented on issue #193:
URL: https://github.com/apache/datasketches-rust/issues/193#issuecomment-5248310326
Do we need to distinguish between resident memory size(shallow) and serialized size(deep)?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@datasketches.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@datasketches.apache.org
For additional commands, e-mail: dev-help@datasketches.apache.org