Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce seemingly inactive / dead time #104

Open
drahnr opened this issue Aug 26, 2020 · 3 comments
Open

Reduce seemingly inactive / dead time #104

drahnr opened this issue Aug 26, 2020 · 3 comments
Labels
checker generic checker topics display 💻 Influencing how the output is rendered heavy-duty 🚜 Big features not easy to implement
Milestone

Comments

@drahnr
Copy link
Owner

drahnr commented Aug 26, 2020

Is your feature request related to a use-case? Please describe.
Currently for larger repositories, the program blocks for quite a bit (~10s of seconds) and ultimately spits out all the output.
This sometimes poses the question if the program does anything at all and surely caused a few CTRL+C actions, when it actually was running just fine.

Describe the solution you'd like
Currently one giant documentation object is created and then displayed, but it would be much more flexible if we would work on a per document basis.

With that said, a worker pool could be utilized to do the actual checking and the output could be an async core just processing an mpsc channel.

Describe alternatives you've considered

  • Use rayon with a split into documents, that would reduce the time of initial blockage and would be a low hanging fruit.
  • Add a progress bar, but that would only add complexity to the codebase without any speedup, and adds an additional burden to impl it in the future.

So both alternatives are kind of 🍌


Relevant files:

  • documentation.rs
  • check.rs
  • main.rs
@drahnr drahnr added checker generic checker topics display 💻 Influencing how the output is rendered heavy-duty 🚜 Big features not easy to implement labels Aug 26, 2020
@drahnr drahnr added this to the v0.6.0 milestone Aug 26, 2020
@drahnr drahnr changed the title Reduce seemingly inactive time Reduce seemingly inactive / dead time Aug 26, 2020
@drahnr
Copy link
Owner Author

drahnr commented Feb 26, 2021

The rayon impl is already done, currently nlprule takes quite a bit of time to parse the inbaked rules data. So that's something left todo.

@drahnr
Copy link
Owner Author

drahnr commented Apr 16, 2021

bminixhofer/nlprule#66 remedies the nlprule upfront loadtime a bit as of v0.8.0-beta.3, but not quite enough to close this

@drahnr
Copy link
Owner Author

drahnr commented Oct 13, 2021

Now processing is async so, output is not bound to all the processing being complete anymore. The whole thing is now somewhat latency optimized.

The remaining item is to cache the nlprule::Tokenizer so the initial loading time is kept to a minimum, which will require changes to nlprule and - if one wants to avoid regex recompilation - also to fancy_regex/regex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
checker generic checker topics display 💻 Influencing how the output is rendered heavy-duty 🚜 Big features not easy to implement
Projects
None yet
Development

No branches or pull requests

1 participant