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

perf: sampler optimization #4882

Merged
merged 5 commits into from
Oct 31, 2024
Merged

perf: sampler optimization #4882

merged 5 commits into from
Oct 31, 2024

Conversation

istae
Copy link
Member

@istae istae commented Oct 30, 2024

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Description

Cpu profiling revealed that the unnecessary crypto recovery inside soc.FromChunk was the bottleneck.

Open API Spec Version Changes (if applicable)

Motivation and Context (Optional)

profile-4-1
profile-1-4

Related Issue (Optional)

Screenshots (if appropriate):

@@ -130,6 +130,22 @@ func (s *SOC) Sign(signer crypto.Signer) (swarm.Chunk, error) {
return s.Chunk()
}

// UnwrapCAC extracts the CAC inside the SOC.
func UnwrapCAC(sch swarm.Chunk) (swarm.Chunk, error) {
Copy link
Member

Choose a reason for hiding this comment

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

sch = soc.FromChunk and sch.WrappedChunk() is not that performant?

Copy link
Member

Choose a reason for hiding this comment

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

if so, I think later the chunk types could be refactored to serialize/deserialize chunk data only once trough one parent aggregation connection or interface.

@istae istae merged commit 336ff77 into master Oct 31, 2024
14 checks passed
@istae istae deleted the sampler-optimize branch October 31, 2024 23:06
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.

5 participants