Skip to content

docs: add common performance degradation guidance#6520

Merged
kibertoad merged 4 commits intofastify:mainfrom
maxpetrusenko:docs/performance-degradation-guide-4832
Mar 9, 2026
Merged

docs: add common performance degradation guidance#6520
kibertoad merged 4 commits intofastify:mainfrom
maxpetrusenko:docs/performance-degradation-guide-4832

Conversation

@maxpetrusenko
Copy link
Copy Markdown
Contributor

Summary

Adds a focused section to docs/Guides/Recommendations.md that consolidates common causes of performance degradation and links to the existing docs sections that already describe each tradeoff.

This follows the direction discussed in #4832 (short reference section with pointers to detailed docs).

Changes

  • Added TOC entry: Common Causes Of Performance Degradation
  • Added concise section covering:
    • route pattern costs (regexp and many params)
    • constraint overhead (version + async constraints)
    • middleware vs native Fastify integrations
    • response schema impact on serialization speed
    • Ajv allErrors performance and risk note

Closes #4832

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Feb 22, 2026
@maxpetrusenko
Copy link
Copy Markdown
Contributor Author

Updated this PR with review feedback:\n\n- Added the Ajv security guideline link ().\n- Fixed the broken internal docs link from to .\n\nThis should address the internal-link checker issue for this section.

@maxpetrusenko
Copy link
Copy Markdown
Contributor Author

Correction to my previous comment (markdown formatting issue):

Updated this PR with review feedback:

This should address the internal-link checker issue for this section.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a short “Common Causes Of Performance Degradation” reference section to the Fastify recommendations guide, consolidating common throughput/latency pitfalls and pointing readers to the deeper existing documentation.

Changes:

  • Adds a new TOC entry for “Common Causes Of Performance Degradation”.
  • Adds a concise section covering router patterns, constraints, middleware vs native integrations, response schemas, and Ajv allErrors guidance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@maxpetrusenko
Copy link
Copy Markdown
Contributor Author

Updated the PR with the remaining doc follow-ups. The allErrors note now states the concrete DoS/per-request-work tradeoff and the route reference text now matches the existing Url building heading. I also rechecked Fastifys validator docs at the PR base and on current main; both describe the baseline config with allErrors: false. Ready for rereview.

Copy link
Copy Markdown
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

@kibertoad kibertoad merged commit 128ca6e into fastify:main Mar 9, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Causes of degradation

5 participants