robosats icon indicating copy to clipboard operation
robosats copied to clipboard

High load when chat window is open for some time

Open TimmyDove opened this issue 3 years ago • 3 comments
trafficstars

Describe the bug When the chat window is open for a while, the tor browser has quite high cpu usage. It uses about 20-30% of a core on a modern intel notebook cpu, which results in 40% more power consumption (and cooler noise). This is annoying if you have to wait for the peer.

To Reproduce Steps to reproduce the behavior:

  1. Go through order until the chat
  2. Keep chat open for some time. It happens if the counterpart is not connected, haven't checked the other case.

Expected behavior The idle chat should not take that much resources. Not sure if this is due to Robosats or a general tor/websocket problem though.

Desktop (please complete the following information):

  • OS: Linux
  • Browser Tor
  • Version 11.0.14

TimmyDove avatar Jun 15 '22 21:06 TimmyDove

Hey @TimmyDove thanks for pointing this out.

Indeed, I have also noticed high CPU usage in chat, specially after a few messages have been written and the connection is unstable (drops and reconnects).

Every time you reconnect, the server sends all PGP encrypted messages (also if it is your peer the one that reconnects). They get decrypted demanding a lot of CPU. I believe there is quite some redundancy going on in the communication, so this should be an easy fix.

The slow down is even more noticeable in mid/low range smartphones.

Reckless-Satoshi avatar Jun 16 '22 23:06 Reckless-Satoshi

:information_source: This even gets annoying on a mid-high range Notebook after having an elaborated robot 2 robot talk. Probably with these reconnects you've mentioned above, @Reckless-Satoshi .

:hankey: The effect is that a well going conversation does wear-out because the underlying communication channel gets visible to the robots. Unsatisfying.

alaznem avatar Aug 03 '22 21:08 alaznem

The effect is that a well going conversation does wear-out

To this I can only say that RoboSats is not Tinder! :P "Be succinct, do not flirt"

We should aim to get this issue fixed to some extent, but be mindful we are using sort of heavy encryption that you rarely see used on instant communications (same used by Protonmail for emails). So reaching Whatsapp-like level of communication might be out of reach.

Reckless-Satoshi avatar Aug 03 '22 21:08 Reckless-Satoshi