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

regular expressions take up too much time #576

Open
SeasClouds opened this issue Mar 25, 2024 · 6 comments
Open

regular expressions take up too much time #576

SeasClouds opened this issue Mar 25, 2024 · 6 comments
Labels
more info needed More info is needed from the community for us to properly triage and investigate

Comments

@SeasClouds
Copy link
Contributor

Regular expression processing takes up a total of 80% of the time during preprocessing

  preprocessTasks.push(function (): void {
    regexp = /.*\$\(.*/gm;
    preprocessedDryRunOutputStr = preprocessedDryRunOutputStr.replace(
       regexp,
       ""
    );
  });

Do a check before using regular expressions,Does that leave anything out?

  preprocessTasks.push(function (): void {
    regexp = /.*\$\(.*/gm;
    if (preprocessedDryRunOutputStr.indexOf('$(') >= 0) 
      preprocessedDryRunOutputStr = preprocessedDryRunOutputStr.replace(
        regexp,
        ""
      );
  });
@Yingzi1234
Copy link
Collaborator

@gcampbell-msft
We have removed the "Triage" label, but according to the information provided by the user, we are not able to perform the next step of "Triage", could you take a look at it for us? Thanks!

@gcampbell-msft
Copy link
Collaborator

@SeasClouds Is this a suggestion you're making? I'm not sure I fully understand this issue, could you provide more information and context?

@gcampbell-msft gcampbell-msft added the more info needed More info is needed from the community for us to properly triage and investigate label Mar 27, 2024
@SeasClouds
Copy link
Contributor Author

Yes, it's a suggestion , when there is no "$(", regular matching can be skipped
In my project, this step of regular matching did not find any data, but it took me 80% (2 minutes) of my time, which I cannot accept.
Or match to "$(" faster to reduce the required time

@gcampbell-msft
Copy link
Collaborator

@SeasClouds Ah, understood. We'd be happy to consider taking an open source contribution for this! Would you be willing to make a PR?

@SeasClouds
Copy link
Contributor Author

@gcampbell-msft I am happy to contribute to open source. I will submit a PR in my free time, but I don't think it's a good solution as it still takes up a lot of time when encountering "$("

@gcampbell-msft
Copy link
Collaborator

@SeasClouds I understand that you're still requesting a perf improvement for the regex, but if this at least improves the non regex case, then I think it's worth contributing.

SeasClouds added a commit to SeasClouds/vscode-makefile-tools that referenced this issue Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info needed More info is needed from the community for us to properly triage and investigate
Projects
None yet
Development

No branches or pull requests

3 participants