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

Investments: benchmarks #1563

Merged
merged 12 commits into from
Sep 25, 2023
Merged

Investments: benchmarks #1563

merged 12 commits into from
Sep 25, 2023

Conversation

lemunozm
Copy link
Contributor

@lemunozm lemunozm commented Sep 22, 2023

Description

Fixes #918

Changes and Descriptions

  • Benchmark implementation
  • Passing with MockRuntime
  • Passing with altair and centrifuge runtimes.
  • Updated weights in runtimes
  • Extrinsic using the correct weights from benchmarks.

Benchmarking results (already normalized to our node times)

  • update_invest_order() &
  • update_invest_redeem():
    • 94_000_000 + reads(8) + writes(4)
  • collect_investments() &
  • collect_investments_for() &
  • collect_redemptions() &
  • collect_redemptions_for():
    • 97_000_000 + 4_000_000 * N + reads(7) + reads(1) * N + writes(3)

@lemunozm lemunozm added I7-optimisation Enhancement that provides better perfromance or smaller footprint. P7-asap Issue should be addressed in the next days. D2-notify Pull request can be merged and notification about changes should be documented. crcl-protocol Circle protocol related. labels Sep 22, 2023
@lemunozm lemunozm self-assigned this Sep 22, 2023
wischli
wischli previously approved these changes Sep 22, 2023
Copy link
Contributor

@wischli wischli left a comment

Choose a reason for hiding this comment

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

Awesome work @lemunozm! Super clean and easy to follow, loving it.

pallets/investments/src/benchmarking.rs Outdated Show resolved Hide resolved
pallets/investments/src/benchmarking.rs Show resolved Hide resolved
runtime/altair/src/lib.rs Show resolved Hide resolved
libs/types/src/tokens.rs Outdated Show resolved Hide resolved
libs/test-utils/src/mocks/accountant.rs Show resolved Hide resolved
}

#[benchmark]
fn collect_redemptions(n: Linear<1, 10>) {
Copy link
Contributor Author

@lemunozm lemunozm Sep 25, 2023

Choose a reason for hiding this comment

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

Suggested change
fn collect_redemptions(n: Linear<1, 10>) {
fn collect_redemptions(n: Linear<1, { T::MaxOutstandingCollects::get() }>) {

Tech debt once we upgrade to Polkadot v0.9.39

@lemunozm lemunozm enabled auto-merge (squash) September 25, 2023 13:38
@lemunozm lemunozm merged commit e72dfe0 into main Sep 25, 2023
10 checks passed
@lemunozm lemunozm deleted the investments/benchmarks branch September 25, 2023 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crcl-protocol Circle protocol related. D2-notify Pull request can be merged and notification about changes should be documented. I7-optimisation Enhancement that provides better perfromance or smaller footprint. P7-asap Issue should be addressed in the next days.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Benchmarks for pallet-investments
3 participants