I have created a simple canister for a demo app – a companion app to the ic-siwe library. All works well but query calls are kind of slow. I know update calls can take two or more seconds but so does my query calls. Is that expected? I am using stable memory.
@ielashi knows best but, my understanding is indeed than stable memory is a bit slower than heap memory because every access requires deserializion respectively serializion - i.e. every read requires a deserialization and write a serialization of what’s in/out the memory.
That said, if the sample of data is small and entities are not gigantic, I don’t think it should make that a noticable difference.
Regarding your sample, I generally use range instead of iter but I can in your example it does not make much a difference.
Stupid question but, you are also sure that you deployed with query right?
I think that’s indeed the issue. The function seems not to be annotated as a query otherwise Candid UI should render a Query button instead of a call Call button if I’m not mistaken.