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

chore(perf): only use the regular expression for shorter input #691

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

nigrosimone
Copy link
Contributor

@nigrosimone nigrosimone commented Mar 11, 2024

Only use the regular expression STR_ESCAPE for shorter input. The overhead is otherwise too much.

Before

long string without double quotes........................ x 9,395 ops/sec ±6.66% (136 runs sampled)
long string.............................................. x 7,237 ops/sec ±2.61% (175 runs sampled)

After

long string without double quotes........................ x 13,095 ops/sec ±1.26% (184 runs sampled)
long string.............................................. x 13,734 ops/sec ±1.65% (179 runs sampled)

Checklist

@nigrosimone nigrosimone changed the title chore: only use the regular expression for shorter input. The overhea… chore: only use the regular expression for shorter input Mar 11, 2024
@nigrosimone nigrosimone changed the title chore: only use the regular expression for shorter input chore(perf): only use the regular expression for shorter input Mar 11, 2024
Copy link
Member

@gurgunday gurgunday left a comment

Choose a reason for hiding this comment

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

lgtm, @Uzlopak?

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina merged commit d154bf5 into fastify:master Mar 12, 2024
19 checks passed
@cesco69
Copy link
Contributor

cesco69 commented Mar 12, 2024

@mcollina Any plan for a new version? there are some "merged" performance improvement

#691
#689
#688
#686

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.

4 participants