candid icon indicating copy to clipboard operation
candid copied to clipboard

Running out of cycles by removing a field in the Deserialized type

Open hansl opened this issue 5 years ago • 0 comments

We have two structures;

    #[derive(Deserialize)]
    struct CallCanisterArgs1 {
        canister: Principal,
        method_name: String,
        args: Vec<u8>,
        cycles: u64,
    }

    // RUNNING OUT OF CYCLE
    #[derive(Deserialize)]
    struct CallCanisterArgs2 {
        canister: Principal,
        method_name: String,
        cycles: u64,
    }

The CallCanisterArgs2 runs out of cycle if we try to deserialize the same value CallCanisterArgs1 would deserialize, which points to a performance regression when skipping fields.

hansl avatar Mar 16 '21 22:03 hansl