Discourse is using a LOT of CPU in Firefox


(Bart) #1

Hi,

we recently implemented Discourse on our site and our community is having a great experience (see our implementation here).

One thing that troubles me a bit though is CPU usage: I’m writing this on a 2014 Macbook Pro (OSX 10.10.1), and both in Chrome and Firefox, Discourse is consuming between 70% and 100% CPU. It sometimes reaches the point where leaving the forum open is slowing down my entire laptop.

I’ve verified that this happens both on our own forum, but also on this forum, so it seems there’s something in Discourse that may not be working quite right.

Any ideas what might be causing this?

Cheers,

Bart


(Régis Hanol) #2

Do you use any plugins/extensions on your browsers?


(Bart) #3

Good point. I have AdBlock, Evernote and 1Password. I disabled all of them, restarted Firefox but the issue persists.

Upon re-checking, I actually found that Chrome is doing a bit better than Firefox - it hovers around 10-20% CPU load, both with and without add-ons.


(Gerhard Schlager) #4

Nothing out of the ordinary here on a 4 year old Windows PC using the latest Chrome.


(Kane York) #5

I’d guess that something gets trapped in an infinite loop. Could you take a JS profiler dump?


(Jeremy Kossen) #6

SketchFab looks really kool! Kudos!


(Bart) #7

@gerhard Interesting - I’m running OSX, maybe there are differences in browser builds?

@riking Here’s a dump of about 15 seconds, I hope I did it right.

@Jeremy_Kossen thanks!


(Jeff Atwood) #8

Here’s both browsers with this topic open in it, no editor, but as a logged in user.

Posting this from Firefox. Having the editor live does jump it up to 2-4% as I type though.


(Bart) #9

It would seem that this issue is specific to OSX and that Windows is not affected?


(Jeff Atwood) #10

Are you still seeing a lot of CPU use in Firefox today? I was never able to repro this in Windows, anyway…


(Bart) #11

Hey Jeff,

thanks for checking up on this. I did some more tests in Firefox and Chrome with all extensions disabled. While there’s still some residual CPU usage left when idle (~ 15%), it seems it has improved a lot. I see the same behavior on other webpages, so maybe it’s not directly related to Discourse, but rather something odd in OSX.


(Jeff Atwood) #12