-
Notifications
You must be signed in to change notification settings - Fork 253
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
feat: Implement optimized TreeMap iterator functions #428
Conversation
a810239
to
4e06609
Compare
Probably makes sense to add some smoke tests here. There was a funny bug in std when a combination of nth and rev flat out gave wrong results in some cases, and nobody noticed ) |
not related to the PR per-se, but it'd be cool to look into setting up property-based/fuzz testing for collections. std collections give us a good, free oracle we can compare against. The two relevant crates in the rust ecosystem are (from most important to least importat) Which reminds me that I should dig into https://github.com/graydon/photesthesis at some point... |
Yeah, I added some basic tests, but yeah fuzzing probably is out of the scope of this. I'd love to tackle this when I have time. I assume when you mention arbitrary you mean to be used with cargo-fuzz? quickcheck is already used in the SDK for treemap tests, so it is probably the least cost to add those to be run as tests, but definitely would be nice to extensively fuzz all data structures and interactions. |
Not necessary -- I believe that the arbitrary crate is setup in such a way that is useful even without coverage-guided fuzzers, so it should be possible to use it the same way |
And the benefit of doing this over using Edit: Also just to check, do you think anything in this test should change wrt these points? |
The That's I am betting on |
You okay with this being done in a separate PR? I can create an issue later. Rather not increase the scope of this PR if possible |
Sure, I am always for splitting up PR, and for non-blocking PRs! |
Closes #426
This PR just makes the implementation more efficient, to avoid unnecessary storage reads
This should be functionally the same externally, but since it will reduce storage reads it's a breaking change in a smart contract context