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: Implement Lazy Loading for Header Parsing to Avoid Unnecessary Validation #17

Merged
merged 28 commits into from
Jan 10, 2025

Conversation

klkucaj
Copy link
Collaborator

@klkucaj klkucaj commented Dec 17, 2024

PR Description

This PR implements lazy loading for header parsing and validation. Headers are now parsed and validated only when explicitly accessed by the request handler, improving performance and avoiding unnecessary validation for unused headers.

Closes #10

@klkucaj klkucaj force-pushed the feature/lazy-parsing branch 4 times, most recently from a577b00 to 67a9964 Compare December 24, 2024 09:03
@klkucaj klkucaj force-pushed the feature/lazy-parsing branch 2 times, most recently from 9c90c34 to 838824c Compare January 9, 2025 10:57
@SandPod SandPod force-pushed the main branch 7 times, most recently from db7e237 to e2607bc Compare January 9, 2025 12:28
@klkucaj klkucaj force-pushed the feature/lazy-parsing branch from 838824c to 9dfea59 Compare January 9, 2025 12:33
@klkucaj klkucaj force-pushed the feature/lazy-parsing branch from 9dfea59 to fdd40a7 Compare January 9, 2025 12:46
Copy link
Contributor

@SandPod SandPod left a comment

Choose a reason for hiding this comment

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

Neat change, the Lazy Init looks like a minimal and solid solution

I'm missing a general test that is not connected to a specific header. This can be used to validate that we handle the "exception" correctly even if we have no headers that throw in strict mode.

lib/src/relic_server.dart Outdated Show resolved Hide resolved
lib/src/relic_server.dart Outdated Show resolved Hide resolved
lib/src/relic_server.dart Show resolved Hide resolved
lib/src/relic_server.dart Outdated Show resolved Hide resolved
lib/src/relic_server.dart Show resolved Hide resolved
lib/src/headers/headers.dart Outdated Show resolved Hide resolved
lib/src/headers/headers.dart Outdated Show resolved Hide resolved
test/headers/headers_test_utils.dart Outdated Show resolved Hide resolved
lib/src/headers/headers.dart Show resolved Hide resolved
test/exception/relic_exceptions_test.dart Outdated Show resolved Hide resolved
test/exception/relic_exceptions_test.dart Outdated Show resolved Hide resolved
lib/src/headers/headers.dart Show resolved Hide resolved
lib/src/relic_server.dart Outdated Show resolved Hide resolved
lib/src/relic_server.dart Outdated Show resolved Hide resolved
test/exception/relic_exceptions_test.dart Outdated Show resolved Hide resolved
lib/src/headers/headers.dart Show resolved Hide resolved
lib/src/headers/headers.dart Outdated Show resolved Hide resolved
test/headers/header_test.dart Outdated Show resolved Hide resolved
test/headers/header_test.dart Outdated Show resolved Hide resolved
lib/src/relic_server.dart Outdated Show resolved Hide resolved
test/hijack/relic_hijack_test.dart Outdated Show resolved Hide resolved
test/hijack/relic_hijack_test.dart Show resolved Hide resolved
@SandPod SandPod merged commit a52ec39 into serverpod:main Jan 10, 2025
14 checks passed
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.

RELIC: Implement Lazy Loading for Header Parsing to Avoid Unnecessary Validation
2 participants