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

perf/lazy-monkey-patch #125

Merged
merged 9 commits into from
Aug 25, 2022
Merged

perf/lazy-monkey-patch #125

merged 9 commits into from
Aug 25, 2022

Conversation

jlalmes
Copy link
Owner

@jlalmes jlalmes commented Aug 22, 2022

Performance improvements

These changes really only effect nextjs because the entire handler setup will be executed on and every request.

  • Monkey patching of void inputs is lazy and will only happen once a procedure is called (instead of all procedures being monkey patched upfront).
  • No longer running generateOpenApiDocument on handler setup in production. This means we no longer validate your router conforms to our OpenApiRouter spec, we just assume this to be true.

src/adapters/node-http/core.ts Show resolved Hide resolved
src/adapters/node-http/core.ts Show resolved Hide resolved
src/adapters/node-http/core.ts Outdated Show resolved Hide resolved
src/adapters/node-http/monkeyPatch.ts Outdated Show resolved Hide resolved
test/adapters/standalone.test.ts Show resolved Hide resolved
@jlalmes jlalmes added the help wanted Extra attention is needed label Aug 22, 2022
@jlalmes
Copy link
Owner Author

jlalmes commented Aug 22, 2022

I believe this is safe, but would be great if anyone could code review/share thoughts on this PR before I merge 🙌

@jlalmes jlalmes mentioned this pull request Aug 23, 2022
24 tasks
@jlalmes jlalmes merged commit 08742f2 into master Aug 25, 2022
@jlalmes jlalmes deleted the perf/lazy-monkey-patch branch August 25, 2022 12:03
@jlalmes jlalmes removed the help wanted Extra attention is needed label Aug 29, 2022
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.

1 participant