Skip to content

add cu benchmarking#67

Draft
kaze-cow wants to merge 2 commits into
push-funds-to-user-processing-in-finalize-settlefrom
kaze/sc-256-dev-tooling-cu-consumption-benchmarks
Draft

add cu benchmarking#67
kaze-cow wants to merge 2 commits into
push-funds-to-user-processing-in-finalize-settlefrom
kaze/sc-256-dev-tooling-cu-consumption-benchmarks

Conversation

@kaze-cow

@kaze-cow kaze-cow commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Description

Record the CU usage of unit tests through a wrapper function.

Context

As an added step, the CU only measures the usage of the given program ID (typically, the settlement program). Hopefully this allows us to better understand our programs usage without having to worry about other programs.

The measurement function parses the logs output of the transaction execution; after some research, it seems there really isn't a better way to do this, and in fact there are other libraries that seem reasonably popular that in fact follow this (just not a rust lib...).

How to test

Tests were added to verify the correctness of the function with actual testing data. If you would like, you can convert an extra svm.send_transaction call anywhere in the integration tests to use the new common::send_transaction_metered function and see the actual whole thing in action!

Out of Scope

The actual wiring of the tests to use this new function. Will happen in later PR once its confirmed the approach is favorable.

Also it is not yet determined if we should check in the CU measurement JSON file. If we should, it should probably be moved out of target/

@linear-code

linear-code Bot commented Jul 10, 2026

Copy link
Copy Markdown

SC-256

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.

1 participant