You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We identified the following issues (ordered by impact, highest is on top):
it loads all messages
-> solution would be infinite scroll/loading list additionally to the virtual list
the jsonprc request get_messages loads messages sequentially
the jsonrpc request does more requests per message then it needs to
my rough notes about jsonrpc inefficiency
quote: another message is loaded (+contact) -> 1-2 db requests
sender: contact is loaded: db request
webxdc info (loading message again, opening webxdc zip): db and filesystem
reactions: db request
parent_id: db request
get_original_msg_id: db request
get_saved_msg_id: db request
get file bytes (only used for file tab and this could be cached in core): filesystem request
So in total the usage of jsonrpc api `get_messages` does 7-8 extra db calls and atleast 2 filesystem requests to request information that is not needed for the gallery view. These extra calls happen for every message.
Solution
make it an infinite / virtual list
infinite list
show placeholder/skeleton items as long for messages that are loading
make a new jsonrpc call that is optimised to load only what is needed and use that one.
load each image messages in it's own request or make the jsonrpc call load all at once instead of sequentially
I tested both by loading all messages with both:
load each image in own request is the slowest
don't load images sequesntially in jsonrpc method only resulted in 1 second speedup almost, while pushing cpu usage to 100%
so both of those are not really improvements
the jsonrpc method for loading at parallel instead of sequentially
It takes seconds until the images are displayed.
We identified the following issues (ordered by impact, highest is on top):
-> solution would be infinite scroll/loading list additionally to the virtual list
get_messages
loads messages sequentiallymy rough notes about jsonrpc inefficiency
Solution
the jsonrpc method for loading at parallel instead of sequentially
The text was updated successfully, but these errors were encountered: