SIGN IN SIGN UP
FuelLabs / fuel-core UNCLAIMED

Rust full node implementation of the Fuel v2 protocol.

0 0 15 Rust

chore(benchmarks): add benchmarks for niop opcode in all operation modes (#3050)

## Added
A new benchmarking group for `niop` operations in the `alu.rs` file. The
changes add comprehensive benchmarks for various operations (`ADD`,
`SUB`, `MUL`, `EXP`, `SLL`, `XNOR`) across different operand widths
(`U8`, `U16`, `U32`)

### Additions to benchmarking:

* A new `niop` benchmarking group was added to evaluate the performance
of narrow integer operations (`niop`) with different operand widths
(`U8`, `U16`, `U32`).
* Introduced the `niop_bench` macro to simplify the creation of
benchmarks for operations like `ADD`, `SUB`, `MUL`, `EXP`, `SLL`, and
`XNOR`.
* Benchmarks iterate over generated operand pairs for each width,
ensuring a variety of test cases for each operation.

## Breaking
- Used a new `fuel-vm 0.64.0` release which brings breaking changes:
https://github.com/FuelLabs/fuel-vm/releases/tag/v0.64.0
- The default gas cost has been changed according to new optimizations
and a new benchmark machine for a local node.
- Receipts now are behind an `Arc` pointer to avoid unnecessary cloning.
It affects transaction states and preconfirmations.
- The `deploy_contract_with_id` now works with `[u8]` instead of the
`Contract` type.

## Changed
Actualized benchmarks with the performance of the network. With this
change we should be able to run benchmarks on nightly bases.

Added several optimizations to the code base:
- Executor now reuses the memory instance between blocks production and
validation avoiding allocations.
- Receipts are not cloned anymore from the VM. Instead, they are
extracted from the VM and stored ina s shared pointer.
- The gas usage for script is discovered in a faster way.
- `Create` transaction doesn't require a cloning of the contract
bytecode anymore to calculate its `ContractId`.
- Serialization and deserialization of the bytes became much faster for
canonical, `postcard`, `bincode` codecs.

---------

Co-authored-by: Green Baneling <XgreenX9999@gmail.com>
A
Aaryamann Challani committed
df471f9b58fcb906b78a41e88aa2b86c095a96e0
Parent: e4750d7
Committed by GitHub <noreply@github.com> on 10/10/2025, 9:13:15 AM