riot-embedded icon indicating copy to clipboard operation
riot-embedded copied to clipboard

Resource consumptions (CPU load)

Open glunardi opened this issue 3 years ago • 3 comments

Thank you for the great project! Considering using it to embedded some Matrix rooms into BigBlueButton (BBB) for a conference in a few weeks time. If not mistaken the KDE community tried to do the same last year.

Initial testing shows that with minimal customizations (which we would be happy to propose here for consideration) it might be a viable option for us.

My main concern at present, with the limited testing I have done, is resource utilization. Accessing riot-embedded from Chrome 91 on Linux seems to require a lot of CPU to run the application in the browser.

Is this something you are aware of?

Combining riot-embedded's load with BBB's might just be too much for some of our users with slow laptops or Chromebooks for example.

glunardi avatar Jul 13 '21 22:07 glunardi

Hello Guy,

Thank you for the feedback. I wasn't aware of any such bottleneck and didn't notice any excess CPU usage on my browser. Can you mention the steps to replicate or test this?

Thanks

arnav-t avatar Jul 17 '21 10:07 arnav-t

Thank you for your reply.

So far my testing has only been by serving up the webpack using npm start directly.

Even without entering credentials (need to prepare guest accounts for testing), you can see the usage by just visiting: http://45.79.131.203:9000/

Just visit that url and staying on the modal login dialog, you can see that the web app is using quite a bit of resources.

Sadly I have not found time to look into it further but really hope we can make use of riot-embedded for our conference. That would be great.

glunardi avatar Jul 20 '21 06:07 glunardi

I profiled it a little. The culprit is spamming Window.postMessage. Take a look at https://github.com/arnav-t/riot-embedded/blob/master/classes/message-handler.js. You handle a message, and then create a new one, which leads to another handling... Also, having a "*" targetOrigin is a bad practice

0xCA avatar Mar 23 '24 03:03 0xCA