Skip to content

perf: lazy loading - #43

Merged
jkowalleck merged 14 commits into
mainfrom
perf/lazy-loading
Jul 20, 2026
Merged

jkowalleck merged 14 commits into
mainfrom
perf/lazy-loading

Conversation

@jkowalleck

@jkowalleck jkowalleck commented Jul 20, 2026 •

Copy link
Copy Markdown
Collaborator

lazy-load expensive public symbols.

continues the work of willynilly#8

djrobstep and others added 9 commits September 4, 2025 22:25
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces lazy loading for the RFC3987 grammar and parser objects to reduce import-time overhead, continuing prior work on performance improvements.

Changes:

  • Replace eager module-level grammar/parser initialization with lazy, lock-protected getters.
  • Add module-level __getattr__ / __dir__ to lazily expose grammar and syntax_parser as public attributes.
  • Document the performance change in CHANGELOG.md.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
src/rfc3987_syntax2/syntax_helpers.py Implements lazy initialization for grammar/parser and lazy-loaded public module attributes.
CHANGELOG.md Notes the new lazy-loading behavior under Unreleased changes.

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

Comment thread src/rfc3987_syntax2/syntax_helpers.py Outdated
Comment thread src/rfc3987_syntax2/syntax_helpers.py Outdated
Comment thread src/rfc3987_syntax2/syntax_helpers.py
Comment thread src/rfc3987_syntax2/syntax_helpers.py
Comment thread src/rfc3987_syntax2/syntax_helpers.py
Comment thread CHANGELOG.md Outdated
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
jkowalleck and others added 2 commits July 20, 2026 15:48
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
@jkowalleck
jkowalleck merged commit 071c4ee into main Jul 20, 2026
22 checks passed
@jkowalleck
jkowalleck deleted the perf/lazy-loading branch July 20, 2026 15:33
@jkowalleck

Copy link
Copy Markdown
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants