nextcloud / passman-webextension

Webextension for the Passman Nextcloud app. Also offers browser extension & Android app.
https://passman.cc
GNU Affero General Public License v3.0
114 stars 43 forks source link

Chrome Extension constantly eating CPU #225

Closed mobamoba closed 6 years ago

mobamoba commented 6 years ago
### Steps to reproduce 1. Happens constantly. 2. 3. ### Expected behaviour Tell us what should happen When idle, the Passman Extension should be doing little to nothing. ### Actual behaviour Tell us what happens instead Passman eating enormous amounts of CPU at all times regardless of whether it's being used or not. ### Configuration **Operating system**: Chrome OS **Browser**: Chrome 64 beta **Extensions that might cause interference**: **Passman version**: 2.14 **Extension version**: 2.04 **Nextcloud version**: 13 beta 3 #### Browser log
Browser log ``` Insert your browser log here, this could for example include: a) The javascript console log b) The network log c) ... ```
brantje commented 6 years ago

I think is is a dupe of #201, closing

mobamoba commented 6 years ago

Okay. I don't have the hanging though, just sluggishness and, when I check the Chrome Task Manager, I see the CPU usage of the Passman extension being extremely high.

brantje commented 6 years ago

image 3% isn't much to me. Can you tell me the configuration of your pc and a screenshot of chrome's task manager?

mobamoba commented 6 years ago

I'm using an Acer Chromebook R11 Processor: 1.6GHz quad-core Intel Celeron N3150 (quad-core, 3MB cache, up to 2.08GHz with Turbo Boost) Graphics: Integrated Intel HD Graphics. Memory: 4GB DDR3L.

What other info would be helpful to pass along to you? The screenshot below is an example of the high CPU usage when Passman is doing absolutely nothing - I was just browsing a website:

screenshot 2017-12-21 at 7 56 10 am

mobamoba commented 6 years ago

Here's another example. This was Passman usage after visiting the NY Times website for a few minutes - I wasn't doing anything, not logging in, not switching pages, not even reading the article; it was simply an open tab in my browser. I switched back to it, let it "settle" for a few minutes then took this screenshot of the Task Manager:

imageedit_2_5755460713

brantje commented 6 years ago

How many vaults do you have configured? And what is the total number of credentials? Just tested with the NY Times site, here is the result, with 389 credentials in the extension: image

mobamoba commented 6 years ago

1 vault. 864 credentials.

I'm on Chrome 64 beta. Perhaps Google made a change that's affecting the extension?

brantje commented 6 years ago

Possible. Otherwise it might be that the page content changes frequently, what triggers the extension to scan for forms. Do you have this on all websites or just some?

mobamoba commented 6 years ago

Everywhere to varying degrees. Passman is never at 0 no matter what site I'm on. It drops as low as 5-10 and I've seen it as high as 90-100. Again, this is just when browsing and not when it's actually in use.

mobamoba commented 6 years ago

Even just sitting here on Github, it's jumping from 7% to 18% then 23%.

brantje commented 6 years ago

Yea, the extension has background job(s). Meaning fetching new / updated credentials, decrypting them and storing them in memory.

mobamoba commented 6 years ago

Are you saying that using 23% of my CPU is normal for an extension that's doing nothing? Because your example had Passman at 0, which I never have.

Is there a way to debug this better so you can see why it's using so much CPU?

animalillo commented 6 years ago

Also sites like github are constantly checking for updates and refreshing parts of the page, this could trigger passman processor to check for log in fields

animalillo commented 6 years ago

To check for passman behaviour open the browser with just a single tab with a static content, unlock the extension and check cpu usage

mobamoba commented 6 years ago

Right but from the screenshot above we already know it's a problem because @brantje got 0% Passman usage on the exact same site where I was getting 23% usage.

animalillo commented 6 years ago

We can't fix a problem without being able to replicate it first.

And beta software is not fully reliable, some weird stuff can happen. So i think it's safe if this only happens on the beta chrome.

Also same site does not mean same page or same open tabs. There is a lot that can be going on your side that we don't know

mobamoba commented 6 years ago

Right, that's why I wanted to know if there was other debugging information I could pass along other than screenshots of my CPU usage that might show you what's going on with Passman under the hood and help understand what's generating that high CPU usage.