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

benchmark: fix some RegExp nits #13551

Closed
wants to merge 2 commits into from
Closed

benchmark: fix some RegExp nits #13551

wants to merge 2 commits into from

Conversation

vsemozhetbyt
Copy link
Contributor

@vsemozhetbyt vsemozhetbyt commented Jun 8, 2017

Checklist
Affected core subsystem(s)

benchmark

  • Take RegExp instance creation out of a cycle.
  • Use test(), not match() in a boolean context.

@nodejs-github-bot nodejs-github-bot added benchmark Issues and PRs related to the benchmark subsystem. buffer Issues and PRs related to the buffer subsystem. crypto Issues and PRs related to the crypto subsystem. labels Jun 8, 2017
@vsemozhetbyt vsemozhetbyt removed buffer Issues and PRs related to the buffer subsystem. crypto Issues and PRs related to the crypto subsystem. labels Jun 8, 2017
@vsemozhetbyt
Copy link
Contributor Author

// Parse configuration arguments
for (const arg of argv) {
const match = arg.match(/^(.+?)=([\s\S]*)$/);
const match = arg.match(validArgRE);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not validArgRE.test(arg)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is some match[capture_index] processing below.

@vsemozhetbyt
Copy link
Contributor Author

Landed in 8beff64

@vsemozhetbyt vsemozhetbyt deleted the regexp-nits-benchmark branch June 12, 2017 09:13
vsemozhetbyt added a commit that referenced this pull request Jun 12, 2017
* Take RegExp creation out of cycle.
* use test(), not match() in boolean context.

PR-URL: #13551
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
addaleax pushed a commit that referenced this pull request Jun 12, 2017
* Take RegExp creation out of cycle.
* use test(), not match() in boolean context.

PR-URL: #13551
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@addaleax addaleax mentioned this pull request Jun 12, 2017
@gibfahn gibfahn mentioned this pull request Jun 15, 2017
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmark Issues and PRs related to the benchmark subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants