Skip to content

Conversation

@floor-licker
Copy link

Optimization

  • Replaced full HashMap cloning with a more efficient approach that only clones order hashes
  • Used scoped blocks to manage borrows and avoid conflicts
  • Removed the "this is nasty, plz cleanup" comment as the inefficiency is now cleaned up

Why?

The previous implementation:

  1. Wasted memory by cloning all order data, which could be large structures
  2. Used an inefficient workaround for Rust's borrow checker
  3. Was harder to read

Performance Impact

This optimization should reduce memory usage and improve performance, especially when dealing larger numbers of orders. All of the tests are passing with the optimization.

Feel free to reply if there are any questions, I also always appreciate feedback.

@floor-licker
Copy link
Author

Hey @codyborn , just wanted to check in to see if I could get some feedback on this PR.

Thanks!

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.

1 participant