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

[Testing] Performance tests for 'store' collections. #1195

Merged
merged 57 commits into from
Jun 26, 2024

Conversation

ruseinov
Copy link
Collaborator

@ruseinov ruseinov commented Jun 7, 2024

This covers basic operations for store collections as well as comparison between Unordered* and Iterable* iteration performance.

@ruseinov
Copy link
Collaborator Author

ruseinov commented Jun 8, 2024

This works fine on other platforms, but fails the osx CI.
Locally on OS X it works, but can be reproduced by limiting the thread amount: #[tokio::test(flavor = "multi_thread", worker_threads = 2)].
My guess is that the machine running mac os x tests just does not have enough CPU.

Potential fixes:

  1. Remove parallelism - that'll result in very slow test runs.
  2. Disable this on osx CI - it's enough to run those tests on linux.
  3. Upgrade the macos GH runner: https://github.blog/2023-03-01-github-actions-introducing-faster-github-hosted-x64-macos-runners/

@ruseinov
Copy link
Collaborator Author

ruseinov commented Jun 9, 2024

This works fine on other platforms, but fails the osx CI. Locally on OS X it works, but can be reproduced by limiting the thread amount: #[tokio::test(flavor = "multi_thread", worker_threads = 2)]. My guess is that the machine running mac os x tests just does not have enough CPU.

Potential fixes:

  1. Remove parallelism - that'll result in very slow test runs.
  2. Disable this on osx CI - it's enough to run those tests on linux.
  3. Upgrade the macos GH runner: https://github.blog/2023-03-01-github-actions-introducing-faster-github-hosted-x64-macos-runners/

I have fixed this by removing parallelism on account creation. However, it takes under a minute on linux builds and about 10 mins on mac os x. So it might still be interesting to investigate upgrading the runners.
It takes about the same time locally on my mac too, a bit long.

near-sdk/Cargo.toml Outdated Show resolved Hide resolved
near-sdk/tests/test-contracts/store/Cargo.toml Outdated Show resolved Hide resolved
near-sdk/tests/test-contracts/store/src/lib.rs Outdated Show resolved Hide resolved
near-sdk/tests/store_performance_tests.rs Outdated Show resolved Hide resolved
near-sdk/tests/store_performance_tests.rs Outdated Show resolved Hide resolved
near-sdk/tests/test-contracts/store/src/lib.rs Outdated Show resolved Hide resolved
near-sdk/tests/store_performance_tests.rs Outdated Show resolved Hide resolved
near-sdk/tests/store_performance_tests.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@frol frol left a comment

Choose a reason for hiding this comment

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

Please, add a test for random access iteration which was the main motivation for these tests in the first place.

near-sdk-macros/src/core_impl/info_extractor/arg_info.rs Outdated Show resolved Hide resolved
near-sdk/tests/test-contracts/store/src/lib.rs Outdated Show resolved Hide resolved
@ruseinov ruseinov requested a review from frol June 20, 2024 19:27
near-sdk/tests/test-contracts/store/res/store.wasm Outdated Show resolved Hide resolved
near-sdk/tests/store_performance_tests.rs Outdated Show resolved Hide resolved
@ruseinov ruseinov requested a review from frol June 21, 2024 13:30
frol
frol previously approved these changes Jun 21, 2024
Copy link
Collaborator

@frol frol left a comment

Choose a reason for hiding this comment

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

It is so much cleaner now! Great job

I will merge it now and will try to address near-workspaces-rs release sooner rather later. I hope it won't block publishing for near-sdk to crates.io

@ruseinov
Copy link
Collaborator Author

It is so much cleaner now! Great job

I will merge it now and will try to address near-workspaces-rs release sooner rather later. I hope it won't block publishing for near-sdk to crates.io

Thanks for great reviews!

@frol frol merged commit 8c978a4 into near:master Jun 26, 2024
15 checks passed
@frol frol mentioned this pull request Jun 26, 2024
@ruseinov ruseinov deleted the ru/enhancement/store-integration-tests branch June 26, 2024 20:28
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.

2 participants