Coder Social home page Coder Social logo

High CPU usage about php-parameter-hint HOT 6 CLOSED

robertgr991 avatar robertgr991 commented on July 28, 2024
High CPU usage

from php-parameter-hint.

Comments (6)

robertgr991 avatar robertgr991 commented on July 28, 2024 1

Thanks for the info, I'll look into it. It's strange that I know 3 similar extensions and all of them have an issue with CPU usage.

from php-parameter-hint.

robertgr991 avatar robertgr991 commented on July 28, 2024 1

@machadomatt So it seems that js-coroutines package was causing the high CPU usage, it's strange that just by importing it, the CPU went to 30%, without using anything from the module. Can you confirm that the last version 0.5.1 doesn't have this problem?

from php-parameter-hint.

robertgr991 avatar robertgr991 commented on July 28, 2024

Hi @machadomatt ,

I will look into it these days, in order to narrow it down, please answer the following:

  • Is this problem only with the latest version or did you encounter this since you first installed the extension?
  • Does the CPU still goes to 50% and than to 30% if the PHP file that you open has very few possible arguments hints? Or it seems to be independent of the number of possible arguments hints?
  • Can you do the same steps but with the extension disabled by command(CTRL + K H) and see if the CPU still goes up? Basically the extension is still active but won't try to hint anything.
  • Are you using the default settings?

Some methods are still called even if the current active file is not a PHP file and even if you close all PHP files, but it's basically only some if's, the actual hinting is not happening because there is a check for PHP file. This is the expected behaviour.

The CPU usage is clearly abnormal.

from php-parameter-hint.

machadomatt avatar machadomatt commented on July 28, 2024
  • Is this problem only with the latest version or did you encounter this since you first installed the extension?

I can't remember exactly if it was happening when I first install but I noticed it about 2 months ago.

  • Does the CPU still goes to 50% and than to 30% if the PHP file that you open has very few possible arguments hints? Or it seems to be independent of the number of possible arguments hints?

It's independent, tried an one file project with one function and one argument, the CPU usage was the same for a large file with dozens of arguments hints.

  • Can you do the same steps but with the extension disabled by command(CTRL + K H) and see if the CPU still goes up? Basically the extension is still active but won't try to hint anything.

Even disabling with the CTRL + K H shortcut the CPU usage is still the same as if it was enabled.

  • Are you using the default settings?

I am using "phpParameterHint.onSave": false and "phpParameterHint.onChange": true. Disabling them doesn't change the CPU usage.

PS: I did all steps with 0.3.4, 0.4.1 and 0.5.0 versions.

from php-parameter-hint.

machadomatt avatar machadomatt commented on July 28, 2024

Nice! Everything looks good, tested large files and after file processing the CPU usage goes down to 2%, as expected.

Thank you!!

from php-parameter-hint.

robertgr991 avatar robertgr991 commented on July 28, 2024

Great! Thanks for pointing this issue out.

from php-parameter-hint.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.