New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Process received messages in queue #1041
Conversation
@xPaw, adding the |
73a6f80
to
21b08ed
Compare
Did another optimization pass, and removed that ugly 10 second interval timer to hide messages in non visible channels (#96). |
21b08ed
to
5402c28
Compare
Rebased with |
Alright, so I started looking at the code (not tested yet) and I am so confused 😅. |
The main idea of this PR is to append messages to DOM on browser idle callback (giving it time to breathe), and while it might be waiting for the idle event to callback, multiple messages can be received, and if they are, as such, they are processed in a single go. This gives a very nice boost for multiple messages in a single channel, as they get appended to actual DOM with single operation. |
Does not work on iOS Safari:
|
5402c28
to
7bd4b3e
Compare
@kode54 Fixed. |
7bd4b3e
to
b32cb88
Compare
ead6cd9
to
9507232
Compare
9507232
to
636af64
Compare
484cd54
to
6abf685
Compare
9d229aa
to
9265832
Compare
@xPaw, I see some empty checkbox in here, do you still want to work on this? I wouldn't like to start reviewing 300+ lines of changes if you happen to still edit it :) |
@astorije these checkbox might not get even done (the code is fine as is). |
9265832
to
92bfa95
Compare
I have rebased this somewhat, but this certainly breaks condensed messages due to the use of document fragments. I still want to get this eventually merged as this fixed major bottlenecks when receiving huge amount of messages (e.g. when connecting to znc and getting buffer playback). |
@xPaw, what do you think for this PR? Do you need something else done with condensed message so this PR is compatible? I understand you want your other PRs merged before taking up any more work, which is totally fair, do you want to close this PR until condensed stuff makes it possible again? |
@astorije No reason to close this. |
92bfa95
to
dbc5db2
Compare
Creating early PR to gather feedback. Want to hear what @thelounge/maintainers think.
Connecting to ZNC with history playback no longer freezes my browser, and appends messages in small queues instead of as-soon-as-received.
What I want to achieve is to process multiple messages for one channel at once, and append them at once (document fragments). Thus reducing DOM manipulations and style recalculations. This should also prioritise currently active channel.