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

chore: tests for Lazy and moving out of unstable #1268

Merged
merged 19 commits into from
Dec 5, 2024

Conversation

ruseinov
Copy link
Collaborator

@ruseinov ruseinov commented Dec 1, 2024

work on #1199

Copy link

codecov bot commented Dec 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.12%. Comparing base (5a4c595) to head (0fa782d).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1268      +/-   ##
==========================================
+ Coverage   80.01%   80.12%   +0.11%     
==========================================
  Files         102      106       +4     
  Lines       14598    14860     +262     
==========================================
+ Hits        11680    11907     +227     
- Misses       2918     2953      +35     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@akorchyn akorchyn left a comment

Choose a reason for hiding this comment

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

Looks good. For some reason, I expected better performance. E.g. LookupSet which has ~1020 inserts compared to LazyOption with ~1200

near-sdk/tests/test-contracts/lazy/src/lib.rs Show resolved Hide resolved
near-sdk/tests/store_performance_tests.rs Outdated Show resolved Hide resolved
near-sdk/tests/store_performance_tests.rs Show resolved Hide resolved
@akorchyn
Copy link
Collaborator

akorchyn commented Dec 3, 2024

@race-of-sloths score 8

@race-of-sloths
Copy link

@akorchyn Thank you for calling!

@ruseinov Thank you for the contribution! Join Race of Sloths by simply mentioning me in your comment/PRs description and start collecting Sloth Points through contributions to open source projects.

What is the Race of Sloths

Race of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow

For contributors:

  • Tag @race-of-sloths inside your pull requests
  • Wait for the maintainer to review and score your pull request
  • Check out your position in the Leaderboard
  • Keep weekly and monthly streaks to reach higher positions
  • Boast your contributions with a dynamic picture of your Profile

For maintainers:

  • Score pull requests that participate in the Race of Sloths and receive a reward
  • Engage contributors with fair scoring and fast responses so they keep their streaks
  • Promote the Race to the point where the Race starts promoting you
  • Grow the community of your contributors

Feel free to check our website for additional details!

Bot commands
  • For contributors
    • Include a PR: @race-of-sloths include to enter the Race with your PR
  • For maintainers:
    • Invite contributor @race-of-sloths invite to invite the contributor to participate in a race or include it, if it's already a runner.
    • Assign points: @race-of-sloths score [1/2/3/5/8/13] to award points based on your assessment.
    • Reject this PR: @race-of-sloths exclude to send this PR back to the drawing board.
    • Exclude repo: @race-of-sloths pause to stop bot activity in this repo until @race-of-sloths unpause command is called

@ruseinov
Copy link
Collaborator Author

ruseinov commented Dec 3, 2024

@akorchyn comments addressed!

@ruseinov
Copy link
Collaborator Author

ruseinov commented Dec 3, 2024

Looks good. For some reason, I expected better performance. E.g. LookupSet which has ~1020 inserts compared to LazyOption with ~1200

Well, if it has to write on each insert to the storage (via flush) - it makes sense.

akorchyn
akorchyn previously approved these changes Dec 3, 2024
Copy link
Collaborator

@akorchyn akorchyn left a comment

Choose a reason for hiding this comment

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

Small nit that you may skip. Awesome

@@ -49,6 +58,19 @@ impl LazyContract {
}
}

/// This should write twice on each iteration.
#[payable]
pub fn insert_take_flush(&mut self, iterations: u32) {
Copy link
Collaborator

@akorchyn akorchyn Dec 3, 2024

Choose a reason for hiding this comment

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

I would name it insert_take to be consistent with insert_delete.

As I got confused initially that it is same as insert_delete_flush_once

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will do

@ruseinov
Copy link
Collaborator Author

ruseinov commented Dec 3, 2024

Small nit that you may skip. Awesome

I'll need to tune the iterations for the CI, then we are done.. It's a bit of a process, I'll poke you when green.

@ruseinov ruseinov requested a review from akorchyn December 5, 2024 12:52
@ruseinov ruseinov enabled auto-merge (squash) December 5, 2024 12:55
@ruseinov ruseinov merged commit 7bfd315 into master Dec 5, 2024
39 checks passed
@ruseinov ruseinov deleted the ru/enh/lazy-option-unstable branch December 5, 2024 13:06
@frol frol mentioned this pull request Dec 3, 2024
This was referenced Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Shipped 🚀
Development

Successfully merging this pull request may close these issues.

4 participants