Skip to content
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

make ServiceStats an intrinsic #5

Merged

Conversation

andreasgerstmayr
Copy link

  • make ServiceStats an intrinsic
  • skip allocating ServiceStats in rebatchIterator if already allocated
  • clone ServiceStats in Spanset.clone()

* make ServiceStats an intrinsic
* skip allocating ServiceStats in rebatchIterator if already allocated
* clone ServiceStats in Spanset.clone()

Signed-off-by: Andreas Gerstmayr <agerstmayr@redhat.com>
@@ -175,6 +172,7 @@ func (s *Spanset) Release() {

func (s *Spanset) clone() *Spanset {
ss := *s
ss.ServiceStats = maps.Clone(s.ServiceStats)
Copy link
Author

Choose a reason for hiding this comment

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

not 100% sure if a deep clone is required here

Copy link
Owner

Choose a reason for hiding this comment

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

The SpanSet also contains the other data structures like Attributes []*SpansetAttribute and Spans []Span. Both are passed to ss without creating a deep clone first. I think it would be more consistent to do the same for ServiceStats.

I also checked all the parts where s.clone() is called and it does not look like a deep clone is required here

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for checking! I removed the maps.Clone().

Copy link
Owner

@stoewer stoewer left a comment

Choose a reason for hiding this comment

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

I left a comment about the deep clone
Otherwise the PR looks good to me 👍

Signed-off-by: Andreas Gerstmayr <agerstmayr@redhat.com>
@stoewer stoewer merged commit 19dbeab into stoewer:add-vparquet4-encoding Apr 28, 2024
13 checks passed
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