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

Optimized the Search Function #63

Closed
wants to merge 4 commits into from

Conversation

neilnaveen
Copy link
Contributor

  • Refactored the MemorySource struct in memory.go to include referencesBySubjectDigest
  • Updated the NewMemorySource function to initialize these new fields.
  • Modified the LoadEnvelope function to populate these new fields when loading an envelope.
  • Updated the Search function to use these new fields when searching for matching envelopes.
  • These changes improve the efficiency of the search operation by reducing the time complexity.

neilnaveen and others added 3 commits October 30, 2023 13:06
- Refactored the `MemorySource` struct in `memory.go` to include `referencesBySubjectDigest`
- Updated the `NewMemorySource` function to initialize these new fields.
- Modified the `LoadEnvelope` function to populate these new fields when loading an envelope.
- Updated the `Search` function to use these new fields when searching for matching envelopes.
- These changes improve the efficiency of the search operation by
  reducing the time complexity.

Signed-off-by: neilnaveen <[email protected]>
@ChaosInTheCRD
Copy link
Collaborator

@neilnaveen thank you once again for another PR 😄.

I can see that you have certainly made the code more efficient, my only concern is on the side of the complexity of understanding how the maps are operating here with your changes implemented.

I probably will need to pull this down and step through it before accepting. @mikhailswift any thoughts on the changes?

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.

3 participants