Closed andiflabs closed 1 week ago
Very cool!
I would love to see this integrated into a GHA somehow so that a warning is triggered on build if you see an increase in this number for some example TS tests (like sending a transaction, with mint/burn etc).
Yeah, definitely it would be helpful. We could have a variant of this feature that writes stuff to a JSON file, and compare the file contents before/after each test run. Having assertions around the counters would ensure that in the future nobody accidentally introduces performance penalties without realizing it.
Summary
This commit adds an optional feature (that can be enabled only during local development) to print the number of cryptographic operations performed for note decryption and encryption.
This feature is enabled by building
ironfish-rust-nodejs
throughyarn build:stats
. After doing that, and after startingironfish-cli
throughyarn start <command>
, it is possible to trigger the printing of the statistics by sendingSIGUSR1
to the CLI process. The statistics will look like this:All the code related to this feature is in Rust only, and hidden behind a feature flag. The JS/TS code is untouched. As such, this commit has no impact on release builds of Iron Fish.
Testing Plan
cd ironfish-rust-nodejs && yarn build:stats
cd ironfish-cli && yarn start start
pkill -USR1 -f '^/usr/bin/node --expose-gc .* bin/run .*'
)Documentation
N/A
Breaking Change
N/A