Giter Site home page Giter Site logo

Critic timeout about perlnavigator HOT 2 OPEN

pjcj avatar pjcj commented on June 12, 2024
Critic timeout

from perlnavigator.

Comments (2)

bscan avatar bscan commented on June 12, 2024

Sure, this is a good idea. The 25 seconds is fairly arbitrary. I didn't want Critic processes hanging around forever, especially if they've hung or are otherwise not needed. Some related thoughts below:

A config parameter would be straightforward. Alternatively, I could add a "large document mode" for files > N lines that would automatically increase this value. The other piece worth considering is the delay between making changes and kicking off diagnostics. When editing, the Navigator doesn't run critic (or perl -c) on every change event, it waits until the user hasn't typed for 1 second. If we're in "large document mode", it might be worth waiting an extra second or so since it's going to take a long time anyway.

documents.onDidChangeContent((change) => {

Related, the Navigator doesn't kill processes that are no longer needed. If you are editing a file (with typing gaps of at least 1 second), the Navigator will keep spinning off subprocesses to run perl -c and perlcritic. These can pile up a bit and starve other processes of resources, especially on machines/containers with fewer cores. The 1 second wait prevents too many from running simultaneously, but killing processes is another option.

from perlnavigator.

pjcj avatar pjcj commented on June 12, 2024

Thanks for thinking about this.

A "large document mode" is interesting and makes sense. Or perhaps values which are proportional to the size of the document? But in any case there still might be times the values need to be overridden somehow.

I currently have debounce_text_changes = 5000 in my neovim perlnavigator config which, I think, does something similar and won't run navigator more then once every five seconds. I'm happy to wait a little longer to get answers and use a little less power.

In the meantime I have increased the timeout locally and everything is working well.

from perlnavigator.

Related Issues (20)

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.