weechat-matrix-protocol-script icon indicating copy to clipboard operation
weechat-matrix-protocol-script copied to clipboard

matrix.lua makes weechat slow

Open vext01 opened this issue 9 years ago • 11 comments

Hi,

I've bee frustrated with the performance of weechat recently, and I've pinpointed it to matrix.lua. This script makes the UI laggy.

Are there any low-hanging optimisations or workarounds I can try?

Thanks

vext01 avatar Nov 23 '16 12:11 vext01

The matrix protocol makes an extreme number of HTTP requests, especially for large rooms. WeeChat was not designed to handle this as smooth as it could have been.

I have introducted a new setting

/set plugins.var.lua.matrix.presence_filter on

This setting will prevent synapse from sending presence events, and ephemeral events, like typing notification and read notices. This will limit the number of HTTP requests a lot. Please try and see if it helps.

The plan for the future is use a (web)socket transport instead of regular HTTP, which WeeChat supports better. But there is no official such transport yet, only proof of concept proxy.

torhve avatar Nov 23 '16 13:11 torhve

Sadly the UI is still sluggish with this option set. Closing the 'Matrix HQ' buffer helps a lot, but I would like to be in that room ;)

vext01 avatar Nov 23 '16 20:11 vext01

Are you using nicklist? If so, try without it.

torhve avatar Nov 23 '16 20:11 torhve

I'm not using nicklist.

vext01 avatar Nov 24 '16 12:11 vext01

When protocols require a lot of requests like Matrix it should really be done from a separate thread, though I'm not sure if Lua/WeeChat makes that easy to do.

(Though now I feel like trying to implement a plugin version of this script, hah.)

kyrias avatar Nov 25 '16 16:11 kyrias

the script doesn't do any http calls on it's own, I request URLs using weechat's async API for it, so it's that API that is freezing the UI.

torhve avatar Nov 26 '16 00:11 torhve

Ah, that's... disturbing. Might be worth bringing up on the weechat bugtracker.

kyrias avatar Nov 26 '16 00:11 kyrias

Are you caching DNS lookups?

strk avatar Apr 02 '17 19:04 strk

This script causes 100%Cpu usage on one core, which makes it unusable.

roel0 avatar Apr 24 '17 19:04 roel0

Can confirm that disabling nicklist seems to make it usable/better.

NickHu avatar Apr 28 '17 13:04 NickHu

This is duplicate of #30

strk avatar Apr 29 '17 12:04 strk