anchor/tests/bench
acheron 852fcc77be
v0.30.0 (#2909)
2024-04-15 17:20:01 +02:00
..
locks v0.30.0 (#2909) 2024-04-15 17:20:01 +02:00
programs/bench Fix IDL (#2824) 2024-03-10 14:22:23 +01:00
scripts bench: Fix number formatting due to locale difference (#2655) 2023-10-10 13:16:09 +02:00
tests Upgrade Solana to 1.18.8 (#2867) 2024-03-28 05:52:24 +01:00
Anchor.toml bench: Add a script to sync benchmark results for all versions (#2477) 2023-05-03 09:09:41 +02:00
Cargo.toml cli: Require explicit `overflow-checks` flag (#2716) 2023-11-30 00:55:12 +01:00
README.md bench: Show Solana version used in tests (#2543) 2023-06-24 23:28:16 +02:00
bench.json v0.30.0 (#2909) 2024-04-15 17:20:01 +02:00
package.json v0.30.0 (#2909) 2024-04-15 17:20:01 +02:00
tsconfig.json bench: Add benchmarking for stack memory usage (#2617) 2023-08-28 14:13:12 +02:00

README.md

Benchmark tests

The bench program and its tests are used to measure the performance of Anchor programs.

How

We run the same tests that measure some metric for each Anchor version starting from 0.27.0. If the difference between the results is greater than 1%, the new data will be saved in bench.json and Markdown files in /bench will be updated accordingly.

Scripts

📝 TL;DR
If you've made changes to programs or tests in this directory, run anchor run sync, otherwise run anchor test --skip-lint.

anchor test --skip-lint: Run all tests and update benchmark files when necessary. This is the only command that needs to be run for most use cases.


The following scripts are useful when making changes to how benchmarking works.

anchor run sync: Sync all benchmark files by running tests for each version. If you've made changes to the bench program or its tests, you should run this command to sync the results.

anchor run sync-markdown: Sync Markdown files in /bench based on the data from bench.json.

anchor run generate-ix: Generate program instructions with repetitive accounts.


The following script is only for the maintainer(s) of Anchor.

anchor run bump-version -- --anchor-version <VERSION>: Bump the version in all benchmark files.