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

feat(bench): add string searching bench #30

Merged
merged 1 commit into from
Apr 13, 2023
Merged

feat(bench): add string searching bench #30

merged 1 commit into from
Apr 13, 2023

Conversation

Fdawgs
Copy link
Contributor

@Fdawgs Fdawgs commented Apr 8, 2023

Inspired by this beast: fastify/send#39

Comment on lines +19 to +22
.add('Using RegExp.test', function () {
/application\/json/.test(text)
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you can include another one with RegExp cached.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You've lost me @H4ad, mind suggesting an example?

Copy link
Collaborator

@H4ad H4ad Apr 9, 2023

Choose a reason for hiding this comment

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

const testJson = /application\/json/;

.add('Using cached RegExp.test', function () {
  testJson.test(text)
})

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added!

@Fdawgs Fdawgs requested review from H4ad and RafaelGSS April 9, 2023 17:12
@RafaelGSS RafaelGSS merged commit a7c5e82 into RafaelGSS:main Apr 13, 2023
@Fdawgs Fdawgs deleted the feat/string-matching branch April 13, 2023 05:25
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.

3 participants