Open nplasterer opened 1 day ago
Okay I'm going deep on the performance and I'm find 2 areas in particular that are really bad
registerIdentity(signatureRequest)
-1.561s
this took nearly all the time for creating a new clientgetInboxIdForAddress()
- 0.524s
this is a huge hit when you're just trying to find the existing client from the database.
The create method takes both an address and an inboxId. When creating a client for the first time, an apiClient is initialized to call getOrCreateInboxId, and another is created during create. This double initialization contributes to the performance issue. My initial thought was that create should only take an address, and we should handle fetching or creating the inboxId internally. However, we’re constrained by the need to pass the database path to create, and the database path is based on the inboxId. This means the inboxId must be known before calling create.
Lets think about how we might be able to improve this long term.