-
Notifications
You must be signed in to change notification settings - Fork 5
Calling conversations.list()
is SLOW
#13
Comments
Doing further tests, I tried to split the two list methods here: and it seems that So probably an issue with v1 conversations, if that can help? |
conversations.list()
is SLOW
@nmalzieu Thank you for filing this and I can reproduce the slowness very easily just calling
I'll take a quick look today to try and track down the slowness, but one alternative that might be worth investigating in the meantime is using the |
We found a blocking issue in: #13. In the meantime, we recommend developers use WebViews to integrate with `xmtp-js`.
I did some testing between using JavaScriptCore and Hermes on iOS and Hermes seems to be a big bottleneck here. If I disable Hermes in our Podfile, then I can get a cold load of 250 convos in ~3s with a follow-up call taking less than 1s due to caching in our SDK. If I turn Hermes back on, I notice the cold conversations load significantly slows down to ~1m and even the cached version takes seconds.
Next steps: Try to get V8 JavaScript engine working for Android so we can move off Hermes and commit these changes. V8 and iOS 14 will be necessary since we require |
Hi @elisealix22 , thanks I'll try to reproduce! |
@nmalzieu Here's the diff of the branch where I had that working with the
Honestly too soon to call. I don't think either are going to be an easy lift. My instinct was that maybe it's time to switch to JSC/V8 because it's not the first time we've run into performance issues on Hermes. Also, it's noticeably faster to create the 250 convos in the loop on JSC for iOS as well. That said, I have yet to get Android up and running so I think both options are up in the air and need more investigation. |
Update: Using Hermes is a requirement for some so we're going to have to dig in more to figure out what calls are the bottleneck in that environment. |
Thanks @elisealix22 Other issue: it seems to be a bit CPU-intensive and blocking the UI. Like, when doing |
Thanks for this lib and this sample app!
However, I'm having really bad performance with it, do you know if that's normal?
A classic
conversations.list(
) usually takes 2-3 seconds when in the browser or NodeJS.But in the react native environment it takes 42 seconds in the simulator and 58 seconds on my iPhone!
Using the wallet created in app (that's empty) it is almost immediate
Using my own wallet that has 7 conversations on the testnet it takes a very long time
Here is an example code diff to show you what I did in the app (pretty straightforward) : main...nmalzieu:xmtp-react-native:main
Do tell me if you want more information or if we should hop on a call to debug together
The text was updated successfully, but these errors were encountered: