-
Notifications
You must be signed in to change notification settings - Fork 11
feat(sampling): add varopt serde #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
proost
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you include c++ compatibility test cases too?
sampling/varopt_items_sketch.go
Outdated
| } | ||
|
|
||
| // NewVarOptItemsSketchEncoder creates an encoder with the provided writer and serde. | ||
| func NewVarOptItemsSketchEncoder[T any](w io.Writer, serde ItemsSerDe[T]) *VarOptItemsSketchEncoder[T] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you return value not pointer? returning pointer can be allocated in heap. Encoder is used once to encoding. I don't think it has long life cycle. So avoiding allocated in heap is good.
sampling/varopt_items_sketch.go:541:9: &VarOptItemsSketchEncoder[go.shape.string]{...} escapes to heap in NewVarOptItemsSketchEncoder[go.shape.string]:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it, thank you!
sampling/varopt_items_sketch.go
Outdated
| } | ||
|
|
||
| // NewVarOptItemsSketchDecoder creates a decoder with the provided reader and serde. | ||
| func NewVarOptItemsSketchDecoder[T any](r io.Reader, serde ItemsSerDe[T]) *VarOptItemsSketchDecoder[T] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also can you return value?
proost
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see marks handling. it's closer to original code but not same.
Summary
Changes
ref: #98 PR2