Skip to content

Conversation

@rtb-12
Copy link
Contributor

@rtb-12 rtb-12 commented Dec 11, 2025

[core] Add Collections Benchmark App (Rust SDK)

Adds a comprehensive benchmark application for testing CRDT collection performance across different sizes, nesting levels, and operations.

What's Included

New App: apps/collections-benchmark-rust/

  • Benchmark methods for all 7 CRDT collection types
  • Support for different sizes (small: 10-100, medium: 1000-10000, large: 100000+)
  • Support for nesting levels 1, 2, and 3
  • Performance metrics: timing, throughput, size categorization

Collections Benchmarked

  1. Counter (G-Counter) - increment operations
  2. PNCounter - increment, decrement, mixed operations
  3. UnorderedMap - insert, get (levels 1, 2, 3)
  4. UnorderedSet - insert, contains
  5. Vector - push, get
  6. LwwRegister - set, get
  7. ReplicatedGrowableArray (RGA) - insert, insert_str, get_text, delete, delete_range

Test plan

Documentation update


Note

Adds a Rust CRDT collections benchmark app, Criterion benchmarks for runtime/storage, and a CI workflow to run and publish benchmark reports (including E2E).

  • Benchmarks CI:
    • Add workflow /.github/workflows/benchmarks.yml to run runtime, storage, and E2E workflow benchmarks; upload artifacts and post a combined summary.
  • New App:
    • Introduce apps/collections-benchmark-rust (WASM app) with benchmark methods for CRDT collections, build.rs (ABI/state-schema emit), build.sh, reporting script, workflow spec, and README.
  • Runtime Benchmarks:
    • Add Criterion bench suite in crates/runtime/benches/{collections.rs,common.rs} with single- and multi-threaded tests; docs in benches/README.md.
    • Update crates/runtime/Cargo.toml to include criterion and [[bench]] collections.
  • Storage Benchmarks:
    • Add Criterion bench suite in crates/storage/benches/{collections.rs,common.rs} with extensive single-/multi-threaded, value-size, edge-case, and memory tests; docs in benches/README.md.
    • Update crates/storage/Cargo.toml to include criterion and [[bench]] collections.
  • Workspace/Build:
    • Include apps/collections-benchmark-rust in workspace members and build script scripts/build-all-apps.sh.
    • Update Cargo.lock for new package.

Written by Cursor Bugbot for commit 4e7b346. This will update automatically on new commits. Configure here.

- Introduced a new application for benchmarking CRDT collection performance in Rust.
- Implemented various benchmark methods for different collection types and sizes.
- Integrated workflows for automated benchmarking processes.
rtb-12 and others added 5 commits December 11, 2025 16:32
- Introduced a new benchmarking suite using Criterion for measuring performance of various runtime operations.
- Added single-threaded and multi-threaded benchmark groups for map, vector, and nested operations.
- Implemented a GitHub Actions workflow to automate benchmark execution and report generation.
- Updated Cargo.toml to include necessary dependencies for benchmarking.
@github-actions
Copy link

E2E tests report

Protocol: ethereum

Application/Step 0. app install (AllMembers) 1. ctx create 2. wait (Broadcast) 3. ctx invite-join 4. wait (Consensus) 5. call (create_new_proposal, Inviter) 6. get proposals 7. call (send_proposal_messages, Inviter) 8. wait (Broadcast) 9. call (get_proposal_messages, Invitees) 10. call (approve_proposal, Invitees) 11. verify external state
demo-blockchain-integrations
Application/Step 0. app install (AllMembers) 1. ctx create 2. alias create 3. wait (Broadcast) 4. call (set, Inviter) 5. call (get, Inviter) 6. ctx invite-join 7. wait (Consensus) 8. call (get, AllMembers) 9. call (set, Inviter) 10. wait (Broadcast) 11. call (get, AllMembers)
kv-store-test

Protocol: icp

Application/Step 0. app install (AllMembers) 1. ctx create 2. wait (Broadcast) 3. ctx invite-join 4. wait (Consensus) 5. call (create_new_proposal, Inviter) 6. get proposals 7. call (send_proposal_messages, Inviter) 8. wait (Broadcast) 9. call (get_proposal_messages, Invitees) 10. call (approve_proposal, Invitees) 11. verify external state
demo-blockchain-integrations
Application/Step 0. app install (AllMembers) 1. ctx create 2. alias create 3. wait (Broadcast) 4. call (set, Inviter) 5. call (get, Inviter) 6. ctx invite-join 7. wait (Consensus) 8. call (get, AllMembers) 9. call (set, Inviter) 10. wait (Broadcast) 11. call (get, AllMembers)
kv-store-test

Protocol: near

Application/Step 0. app install (AllMembers) 1. ctx create 2. alias create 3. wait (Broadcast) 4. call (get_text, Inviter) 5. call (get_title, Inviter) 6. call (insert_text, Inviter) 7. wait (Broadcast) 8. call (get_text, Inviter) 9. call (get_length, Inviter) 10. ctx invite-join 11. wait (Consensus) 12. call (get_text, AllMembers) 13. call (insert_text, Inviter) 14. wait (Broadcast) 15. call (get_text, Inviter) 16. call (insert_text, Inviter) 17. wait (Broadcast) 18. call (get_text, Inviter) 19. call (delete_text, Inviter) 20. wait (Broadcast) 21. call (get_text, Inviter) 22. call (replace_text, Inviter) 23. wait (Broadcast) 24. call (get_text, Inviter) 25. call (set_title, Inviter) 26. wait (Broadcast) 27. call (get_title, Inviter) 28. call (clear, Inviter) 29. wait (Broadcast) 30. call (get_text, Inviter) 31. call (is_empty, Inviter) 32. wait (Consensus) 33. call (get_text, AllMembers) 34. call (is_empty, AllMembers)
collaborative-editor-test
Application/Step 0. app install (AllMembers) 1. ctx create 2. alias create 3. wait (Broadcast) 4. ctx invite-join 5. wait (Consensus) 6. call (set, Inviter) 7. wait (Broadcast) 8. call (get, AllMembers) 9. call (set, Inviter) 10. call (set, Invitees) 11. wait (Consensus) 12. call (get, AllMembers) 13. call (set, Inviter) 14. wait (Broadcast) 15. call (get, AllMembers)
concurrent-mutations-test
Application/Step 0. app install (AllMembers) 1. ctx create 2. wait (Broadcast) 3. ctx invite-join 4. wait (Consensus) 5. call (create_new_proposal, Inviter) 6. get proposals 7. call (send_proposal_messages, Inviter) 8. wait (Broadcast) 9. call (get_proposal_messages, Invitees) 10. call (approve_proposal, Invitees) 11. verify external state
demo-blockchain-integrations
Application/Step 0. app install (AllMembers) 1. ctx create 2. wait (Broadcast) 3. ctx invite-join 4. wait (Consensus) 5. call (len, Inviter) 6. call (get, Inviter) 7. call (len, Invitees) 8. call (get, Invitees) 9. call (get, Invitees) 10. call (set, Inviter) 11. wait (Broadcast) 12. call (get, Inviter) 13. call (get, Invitees) 14. call (set, Invitees) 15. wait (Broadcast) 16. call (get, Inviter) 17. call (len, Invitees) 18. call (len, Inviter)
kv-store-init-test
Application/Step 0. app install (AllMembers) 1. ctx create 2. alias create 3. wait (Broadcast) 4. call (set, Inviter) 5. call (set, Inviter) 6. call (set, Inviter) 7. call (set, Inviter) 8. call (set, Inviter) 9. call (set, Inviter) 10. call (set, Inviter) 11. call (set, Inviter) 12. call (set, Inviter) 13. call (set, Inviter) 14. wait (Broadcast) 15. call (len, Inviter) 16. ctx invite-join 17. wait (Consensus) 18. call (get, AllMembers) 19. call (get, AllMembers) 20. call (get, AllMembers) 21. call (get, AllMembers) 22. call (get, AllMembers) 23. call (get, AllMembers) 24. call (get, AllMembers) 25. call (get, AllMembers) 26. call (get, AllMembers) 27. call (get, AllMembers) 28. call (len, AllMembers)
kv-store-late-join-test
Application/Step 0. app install (AllMembers) 1. ctx create 2. alias create 3. wait (Broadcast) 4. call (set, Inviter) 5. call (get, Inviter) 6. ctx invite-join 7. wait (Consensus) 8. call (get, AllMembers) 9. call (set, Inviter) 10. wait (Broadcast) 11. call (get, AllMembers) 12. call (update_if_exists, Inviter) 13. call (update_if_exists, Inviter) 14. call (get_or_insert, Inviter) 15. call (get, AllMembers)
kv-store-test
Application/Step 0. app install (AllMembers) 1. ctx create 2. alias create 3. wait (Broadcast) 4. ctx invite-join 5. wait (Consensus) 6. call (set, Inviter) 7. wait (Broadcast) 8. call (get_handler_execution_count, Inviter) 9. call (set, Inviter) 10. wait (Broadcast) 11. call (get_handler_execution_count, Invitees) 12. call (remove, Inviter) 13. wait (Broadcast) 14. call (get_handler_execution_count, Invitees) 15. call (set, Inviter) 16. wait (Broadcast) 17. call (clear, Inviter) 18. wait (Broadcast) 19. call (get_handler_execution_count, Invitees)
kv-store-with-handlers-test
Application/Step 0. app install (AllMembers) 1. ctx create 2. alias create 3. wait (Broadcast) 4. ctx invite-join 5. wait (Consensus) 6. call (set_user_simple, Inviter) 7. call (get_user_simple, Inviter) 8. call (set_user_nested, Inviter) 9. call (get_user_nested, Inviter) 10. call (add_frozen, Inviter) 11. call (get_frozen, Inviter) 12. wait (Consensus) 13. call (get_frozen, AllMembers) 14. wait (Broadcast)
kv-store-with-user-and-frozen-storage
Application/Step 0. app install (AllMembers) 1. ctx create 2. alias create 3. wait (Broadcast) 4. call (increment_counter, Inviter) 5. call (increment_counter, Inviter) 6. wait (Broadcast) 7. ctx invite-join 8. wait (Consensus) 9. call (get_counter, AllMembers) 10. call (increment_counter, Inviter) 11. call (increment_counter, Invitees) 12. wait (Consensus) 13. call (get_counter, AllMembers) 14. call (set_register, Inviter) 15. wait (Broadcast) 16. call (get_register, AllMembers) 17. call (set_register, Invitees) 18. wait (Consensus) 19. call (get_register, AllMembers) 20. call (set_metadata, Inviter) 21. wait (Broadcast) 22. call (get_metadata, AllMembers) 23. call (set_metadata, Invitees) 24. call (set_metadata, Inviter) 25. wait (Consensus) 26. call (get_metadata, AllMembers) 27. call (get_metadata, AllMembers) 28. call (get_metadata, AllMembers) 29. call (push_metric, Inviter) 30. call (push_metric, Inviter) 31. wait (Broadcast) 32. call (metrics_len, AllMembers) 33. call (get_metric, AllMembers) 34. call (add_tag, Inviter) 35. call (add_tag, Inviter) 36. wait (Broadcast) 37. call (has_tag, AllMembers) 38. call (add_tag, Invitees) 39. call (add_tag, Inviter) 40. wait (Consensus) 41. call (has_tag, AllMembers) 42. call (has_tag, AllMembers) 43. call (get_tag_count, AllMembers)
nested-crdt-test
Application/Step 0. app install (AllMembers) 1. ctx create 2. alias create 3. wait (Broadcast) 4. call (set, Inviter) 5. call (get, Inviter) 6. ctx invite-join open-invitation 7. wait (Consensus) 8. call (get, AllMembers) 9. call (set, Inviter) 10. wait (Broadcast) 11. call (get, AllMembers)
open_invitation
Application/Step 0. app install (AllMembers) 1. ctx create 2. alias create 3. wait (Broadcast) 4. call (record_win, Inviter) 5. call (record_win, Inviter) 6. wait (Broadcast) 7. ctx invite-join 8. wait (Consensus) 9. call (get_wins, AllMembers) 10. call (record_win, Inviter) 11. call (record_loss, Invitees) 12. wait (Consensus) 13. call (get_wins, AllMembers) 14. call (get_losses, AllMembers)
team-metrics-test

@rtb-12 rtb-12 marked this pull request as ready for review December 16, 2025 05:53
…moving setup code inside the benchmark iterations
…n scope for improved clarity and consistency
@github-actions
Copy link

Merobox Proposals Workflows Failed

The following proposal workflow(s) failed:

  • near
  • icp
  • ethereum

Please check the workflow logs for more details.

@github-actions
Copy link

Merobox Workflows Failed

The following workflow(s) failed after retries:

  • nested-crdt-test/workflows/nested-crdt-test.yml

Please check the workflow logs for more details.

@chefsale
Copy link
Member

Let's use this branch to debug the latency issues. cc: @xilosada @sept-en @sh3ll3x3c

@github-actions
Copy link

This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated.

@github-actions github-actions bot added the Stale label Dec 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants