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

Use pfgrep instead of QShell grep when possible #2429

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

NattyNarwhal
Copy link

pfgrep is a fast alternative to QShell grep. It aims to be much faster and support the full spectrum of PCRE regular expression functionality.

In my testing, searching for the string Qp0l in QSYSINC/H shows:

  • qshell grep: ~11 seconds
  • pfgrep v0.2: ~8 seconds
  • pfgrep v0.3: ~2 seconds

Quite a big improvement!

Questions include:

  • Should VS Code offer to point you to where to download pfgrep? It's not yet in the IBM repository, but we do have our own repo, RPMs available, and it can be built from source.
  • With faster search, doing things like regular expressions or searching across multiple files/libraries goes from tedious to quite possible. That's out of scope for this PR, but would be quite nice to add. Same deal for regular expressions instead of fixed strings.
  • If you do need any features in pfgrep, let me know. I can prioritize things that VS Code needs.

Changes

Description of change here.

How to test this PR

Examples:

  1. Run the test cases
  2. Expand view A and right click on the node
  3. Run 'Execute Thing' from the command palette

Checklist

  • have tested my change
  • have created one or more test cases
  • updated relevant documentation
  • Remove any/all console.logs I added
  • have added myself to the contributors' list in CONTRIBUTING.md

[pfgrep][pfgrep] is a fast alternative to QShell grep. It aims to be
much faster and support the full spectrum of PCRE regular expression
functionality.

In my testing, searching for the string `Qp0l` in `QSYSINC/H` shows:

- qshell grep: ~11 seconds
- pfgrep v0.2: ~8 seconds
- pfgrep v0.3: ~2 seconds

Quite a big improvement!

Questions include:

- Should VS Code offer to point you to where to download pfgrep? It's
  not yet in the IBM repository, but we do have our own repo, RPMs
  available, and it can be built from source.
- With faster search, doing things like regular expressions or searching
  across multiple files/libraries goes from tedious to quite possible.
  That's out of scope for this PR, but would be quite nice to add. Same
  deal for regular expressions instead of fixed strings.
- If you do need any features in pfgrep, let me know. I can prioritize
  things that VS Code needs.

[pfgrep]: https://github.com/SeidenGroup/pfgrep
@worksofliam
Copy link
Contributor

Should VS Code offer to point you to where to download pfgrep? It's not yet in the IBM repository, but we do have our own repo, RPMs available, and it can be built from source.

This is the main question. I suspect the best we can do is offer a page in our docs (under Tips) specifically for getting pfgrep and what the benefits are.

By default pfgrep includes the full record, including whitespace.
Maybe this should be changed, but this is what it does now; use -t
to match semantics of qsh grep.

Note that this will need pfgrep v0.3.2; there was a bug in character
trimming in previous versions.
We don't have skips I think, so this may be weird.
@NattyNarwhal
Copy link
Author

Might want to wait for next version, I'm working on -f flag support (saving us from having to escape) and inverting behaviour of -t (making it unnecessary for the sake of the unit test).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants