"Optimizing ICP Query Calls: Overcoming Performance Bottlenecks in Fetching & Processing Users"

I’m facing a performance bottleneck while fetching and processing 600-700 users from an ICP canister (Rust) via query calls.

  • Issue: Query calls take 2+ minutes, even though they run in parallel.
  • Approach:
    • Fetch users in 6-7 batches (~100 per batch).
    • Process 25 users concurrently per batch.
  • Problems:
    • Fetching & processing is slow.
    • More batches increase execution time instead of reducing it.

Questions:

  1. Why are ICP query calls slow despite parallel execution?
  2. Does ICP have query call limitations affecting performance?
  3. Why does increasing batches increase execution time?
  4. How can I optimize fetching and processing?

in frontend this is happening approach regarding how can we optimize this

Is it the same situation even if you try fetching via the candid UI?

the thing is in candid we pass one principal and its other parameter it is not returning list we wantr user account data of multiple users in frontend to filter the user with hf <1 which is taking time although it is query call