Query speed discrepency question

I noticed a few months ago that when using the Rust agent you can spare yourself from defining anything on the candid side.

But recently I noticed that when using this method queries where slower, around ~1.50s.
I happened to define the service on the candid side and then noticed that my queries where then ~0.50s, so back to normal. (without any code change on the back end)

I was wondering why queries are 3 times slower when the candid interface is not defined, @roman-kashitsyn do you happen to have any ideas ?

Using dfx 0.11.1

1 Like

Which commands do you type in the terminal?

My apriori interpretation: if the interface is there, dfx understands that you’re trying to call a query method and uses a query call. If the interface is not there, dfx assumes you’re calling an update call and goes through the replicated path.

You can give dfx a hint with dfx canister call --query.