SrainApp / srain

Modern IRC client written in GTK
https://srain.silverrainz.me/
Other
309 stars 35 forks source link

UI hangs when connecting to an IRC bouncer with a lot of channels #420

Open Exagone313 opened 3 months ago

Exagone313 commented 3 months ago

I launched Srain and connected to my IRC bouncer where I have joined 130+ channels. Srain UI hung for a minute while it received messages from each of these channels.

How to reproduce

  1. Get yourself a bouncer and join a lot of channels
  2. Connect to this bouncer with Srain

Actual result

Srain UI hangs while receiving messages (chat buffers) from all the channels.

Expected result

UI runs on a separate thread so that it doesn't hang when receiving a lot of messages at once.

Notes

This probably requires major changes to the design of the app. I am only opening this for tracking.

Exagone313 commented 2 months ago

I have run sysprof to check what is blocking the UI and it appears to come from the usage of gtk_list_store_set in sui_user_update.

I will see if I can improve performance on this part.

SilverRainZ commented 2 months ago

Nice catch, it is a valuable fact. 

I think the UI hangs is caused by the following callstacks:

When the client JOINs a channel, the server sends a SIRC_RFC_RPL_NAMREPLY message to the client, client splits all other clients from message and finally adds them to user list(sui_user_list_add_user). The problem is: User list stat is updated (sui_user_update) every time adding user. The core of this should be to allow multiple users to be added before performing an update. 

31.08.2024, 05:49, "Elouan Martinet" @.>: I have run sysprof to check what is blocking the UI and it appears to come from the usage of gtk_list_store_set in sui_user_update.I will see if I can improve performance on this part.—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.>  -- Best regards,Shengyu Zhang https://silverrainz.me