snarkVM
snarkVM copied to clipboard
[Benchmark] Add benchmarks of `LimitedWriter`
Motivation
LimitedWriter.write_le method is used to verify transaction sizes are below the minimum limit. Thus it makes sense to benchmark this method and the check_transaction method which encapsulates it.
This PR adds benchmarks of the following:
LimitedWriter.write_leand fortransfer_public,transfer_privatemethods withincredits.aleo- Benchmarks of both
VM.check_transactionandLimitedWriter.write_lefor a program calledtoo_big.aleothat generates an execution transaction above160kb.
Results (Mac OSX - M1 Max: 10-core CPU - Memory: 64GB)
LimitedWriter::new - transfer_public
time: [11.136 µs 12.007 µs 13.021 µs]
Transaction::Execute(transfer_public) - verify
time: [15.048 ms 19.123 ms 22.293 ms]
LimitedWriter::new - transfer_private
time: [11.076 µs 12.442 µs 13.927 µs]
Transaction::Execute(transfer_private) - verify
time: [14.654 ms 19.755 ms 25.494 ms]
LimitedWriter::new - too_big.aleo (164613 bytes)
time: [2.1626 ms 2.4037 ms 2.6260 ms]
Transaction::Execute(too_big.aleo) - verify (164613)
time: [2.0601 ms 2.2421 ms 2.4375 ms]
Results
LimitedWriterfor transactions over the maximum are about 15% of the total runtime.LimitedWriter.write_lefor transfer_publics execution transactions (which are ~3kb) take %0.07 of the total runtime of the check_transaction check.- For transactions over the size check limit - the total verification time is shortened.