Skip to content

PERF: Lazily load all package exports - #2

Closed
richlundeen wants to merge 1 commit into
rlundeen2-speed-pyrit-cold-startfrom
rlundeen2-all-package-lazy-imports
Closed

PERF: Lazily load all package exports#2
richlundeen wants to merge 1 commit into
rlundeen2-speed-pyrit-cold-startfrom
rlundeen2-all-package-lazy-imports

Conversation

@richlundeen

Copy link
Copy Markdown
Owner

Summary

  • migrate remaining exported pyrit/**/__init__.py packages to the shared PEP 562 lazy-export contract
  • preserve package APIs, aliases, object identity, transformer warning suppression, and show_versions compatibility
  • explicitly materialize dataset and scenario catalogs only when complete discovery is requested
  • retain the intentional GCG experimental-warning import side effect

Depends on microsoft#2455.

Cold start performance

Cold Start Benchmark Before Change After Change Faster
Text matching scorers 7.654465s 6.115633s 20.1%
ROT13/Base64/Base2048 converters 4.986345s 0.562701s 88.7%
import pyrit.memory 5.448382s 0.094392s 98.3%
import pyrit.datasets 8.121517s 0.094086s 98.8%

Each result is the median of seven fresh-process runs.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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