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

refactor: remove expensive clones from verify_consistency_of_operations; convert API to slice #285

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Commits on Mar 18, 2024

  1. refactor: remove expensive clones from verify_consistency_of_operatio…

    …ns; convert API to slice
    
    There was never any need for this function to take in a &Vec; we should never do that. Instead take in a slice.
    
    Additionally, we refactored some of the loop logic to use .take instead of a check on each iteration to see if we were at the end. We also combined two duplicate for loops into 1.
    
    Finally, we significantly refactor the return type to avoid a lot of very expensive cloning. Previously, we were doing something on the magnitude of 9 clones (of expensive underlying objects including vectors) per input GroveDbOp. All of these have been removed. We instead return references to these values instead of clones of them. This does mean that the lifetime of the return value is tied to the underlying data the slice refers to; but especially as I cannot even find an instance where we use these return values, this feels like a very fair trade off.
    PastaPastaPasta committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    2ea41a3 View commit details
    Browse the repository at this point in the history
  2. chore: use filter

    PastaPastaPasta committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    d998701 View commit details
    Browse the repository at this point in the history

Commits on Mar 22, 2024

  1. chore: use matches!

    PastaPastaPasta committed Mar 22, 2024
    Configuration menu
    Copy the full SHA
    3ece070 View commit details
    Browse the repository at this point in the history