High latency (2s+) for a simple update request on Mainnet

actor {
   public func greet(name : Text) : async Text {
     return Hello,  # name # !;
sequence method started at request time
1 call 0s 329.06ms
2 read_state 330.14ms 625.4ms
3 read_state 1.14s 953.24ms
4 read_state 2.26s 506.58ms
5 read_state 2.95s 474.19ms

We didn’t get the result of greet call until request #5, that’s 3 seconds.

Check it here:

If you are not modifying the state, you should specify that it’s a “query call”.
public query func greet(name : Text) : async Text {

Query calls are much faster but less secure as it gives you the first node response without consensus.

We didn’t specify it as a “query call” in purpose - try to investigate the minimum latency of a simplest update call.
In theory, it should be 1 block latency, which is 0.7s - 1s
In reality, the latency is 2s+ (after substract the request time)
We want to know WHY high latency, and if this IS the reality now is there any plan/practise improving the latency.

1 Like

Alright ! I wanted to be sure. Interesting question, hope the guys will know better !

I’m pretty sure this involves two messages (and blocks), one for the request, and one for the reply. In addition, the UI has to poll the gateway to get the status of the reply, adding more latency.

1 Like