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

feat: add benchmarking suite #25

Merged
merged 18 commits into from
Sep 26, 2023
Merged

feat: add benchmarking suite #25

merged 18 commits into from
Sep 26, 2023

Conversation

h5law
Copy link
Collaborator

@h5law h5law commented Sep 18, 2023

Description

Summary generated by Reviewpad on 26 Sep 23 07:27 UTC

This pull request includes the following changes:

  1. The Makefile has been modified to add several targets and their corresponding commands. The new targets are: help, list, test_all, benchmark_all, benchmark_smt, benchmark_smt_fill, benchmark_smt_ops, benchmark_smst, benchmark_smst_fill, and benchmark_smst_ops. Each target has a description comment above its definition.

  2. The file diff adds two test functions: "TestSMT_ProofSizes" and "TestSMST_ProofSizes". These tests create a sparse Merkle tree and perform various operations on it. The tests calculate and log the average, minimum, and maximum sizes of serialized proofs and compacted proofs for different tree sizes ranging from 100,000 to 10,000,000.

  3. The file "bench_test.go" has been deleted. It used to contain benchmark functions for updating and deleting data in a Sparse Merkle Tree. These benchmarks relied on a Key-Value Store and utilized the "testing" package. The functions performed operations such as updating and deleting data using the Sparse Merkle Tree. The benchmarking logic included timing and memory allocation measurements. The Key-Value Store was stopped at the end of each benchmark.

  4. A new file called "bench_utils_test.go" has been introduced in the "benchmarks" package. The file contains benchmarking functions for the "smt" package and the "smst" package. It also includes helper functions for setting up the data structures and benchmarking functions for them. Overall, this file provides testing and benchmarking capabilities for the "smt" and "smst" packages.

  5. Changes have been made to the ".gitignore" file to ignore the ".idea/" directory and remove the "testdata/" directory from being ignored.

  6. The .github/workflows/test.yml file has been modified. Specifically, the run section of the Create coverage report and run tests job has been updated. Additionally, a new condition has been added to the Sanitize test results step.

  7. The file "bench_leaf_test.go" has been modified to add two benchmark test functions: "BenchmarkSMTLeafSizes_Fill" and "BenchmarkSMSTLeafSizes_Fill". These benchmarks test the performance of filling a sparse Merkle tree with different sizes of leaves. They use different objects and parameters for the tree update operation.

Please let me know if you need further assistance with this diff!

Issue

Fixes #9

Type of change

Please mark the relevant option(s):

  • New feature, functionality or library
  • Bug fix
  • Code health or cleanup
  • Major breaking change
  • Documentation
  • Other

List of changes

  • Add benchmarking suite for SM(S)T
  • Add benchmark results to main readme

Testing

  • Task specific tests or benchmarks: go test ...
  • New tests or benchmarks: go test ...
  • All tests: go test -v

Required Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added, or updated, godoc format comments on touched members (see: tip.golang.org/doc/comment)
  • I have tested my changes using the available tooling

If Applicable Checklist

  • Update any relevant README(s)
  • Add or update any relevant or supporting mermaid diagrams
  • I have added tests that prove my fix is effective or that my feature works

Sorry, something went wrong.

Unverified

This user has not yet uploaded their public signing key.

Unverified

This user has not yet uploaded their public signing key.

Unverified

This user has not yet uploaded their public signing key.

Unverified

This user has not yet uploaded their public signing key.

Unverified

This user has not yet uploaded their public signing key.

Unverified

This user has not yet uploaded their public signing key.

Unverified

This user has not yet uploaded their public signing key.
@h5law h5law added documentation Improvements or additions to documentation tests labels Sep 18, 2023
@h5law h5law requested review from red-0ne and Olshansk September 18, 2023 10:46
@h5law h5law self-assigned this Sep 18, 2023
@reviewpad reviewpad bot added large Pull request is large waiting-for-review This PR is currently waiting to be reviewed and removed documentation Improvements or additions to documentation labels Sep 18, 2023
@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (1df1f48) 84.77% compared to head (3c0330e) 84.77%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #25   +/-   ##
=======================================
  Coverage   84.77%   84.77%           
=======================================
  Files           8        8           
  Lines        1241     1241           
=======================================
  Hits         1052     1052           
  Misses        138      138           
  Partials       51       51           

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

Unverified

This user has not yet uploaded their public signing key.
Base automatically changed from cleanup_docs to main September 19, 2023 12:24

Unverified

This user has not yet uploaded their public signing key.

Unverified

This user has not yet uploaded their public signing key.

Unverified

This user has not yet uploaded their public signing key.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Unverified

This user has not yet uploaded their public signing key.

Unverified

This user has not yet uploaded their public signing key.

Unverified

This user has not yet uploaded their public signing key.
@h5law h5law requested a review from Olshansk September 25, 2023 17:47
Olshansk
Olshansk previously approved these changes Sep 26, 2023
Copy link
Member

@Olshansk Olshansk left a comment

Choose a reason for hiding this comment

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

Left a couple more comments but feel free to merge after.

Unverified

This user has not yet uploaded their public signing key.

Unverified

This user has not yet uploaded their public signing key.

Unverified

This user has not yet uploaded their public signing key.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
large Pull request is large tests waiting-for-review This PR is currently waiting to be reviewed
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Testing] Enhance overall testing in the repo
2 participants