Repository navigation
perf(gapic-generator): lazily import unversioned package exports - #19032
GouthamMahesh wants to merge 2 commits into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request implements PEP 0810 (Explicit Lazy Imports) for Python 3.15+ by generating a __lazy_modules__ set in the package initialization templates. It updates the corresponding golden files and adds integration and unit tests to verify the behavior. The reviewer suggested improving the formatting of the generated __lazy_modules__ elements by applying an indentation filter in the Jinja template to comply with PEP 8 guidelines.
|
Hi @GouthamMahesh, Thanks for providing a performance fix! Please could you sign the CLA? Once it's signed, please mark the PR as |
Add native Python 3.15 lazy imports to the unversioned package template, matching the existing versioned package behavior. Includes regression tests and eight updated golden files.
Version metadata stays eager. Export names and resolved objects stay the same. Older Python versions keep eager imports.
Related to #18987. The 300 ms threshold stays unchanged.
Replayed the original BackupDR revision pair with Python 3.15.1, pinned CI dependencies, and the original 100 ms profiler threshold:
Local measurements used Linux ARM64 and 11 fresh processes per condition, discarding the first. The unchanged local pair also passes the 15% relative gate, so this does not reproduce the original CI failure exactly. This measures bare imports. Loading costs, side effects, and dependency errors move to first use. SDKs receive the change through regeneration.
Validation:
cp -Tcommand.