brandly / Lax

IRC client built with Electron & React
https://github.com/brandly/Lax
MIT License
137 stars 26 forks source link

move old messages out of memory #17

Open brandly opened 6 years ago

brandly commented 6 years ago

this thing will just keep sucking up messages and eating up memory as long as you leave it open. it also gets increasingly stressful for react to render larger conversations. (improving MessageList rendering significantly improved react performance, but switching to a long conversation still hangs slightly)

in the short term, it'd be easy to cap messages per convo and just forget about old messages.

eventually, it'd be nice if this cached old messages to disk. we'd have to coordinate reading them in as you scrolled and such, which would take some work. rejoining a channel and seeing messages from when you were last online would be cool tho

Fohlen commented 6 years ago

electron.session could come handy here to cache the electron.WebContents process from our renderer processes

brandly commented 4 years ago

just in case anyone comes across this, i think the most pressing issue here is that switching channels lags a bit when a lot of messages have built up. i think a virtualized list would solve this, but i haven't experimented yet. this seems to be the component everyone uses!