Skip to content

refactor(storage): dynamically import mime and p-limit with module caching - #9230

Draft
thiyaguk09 wants to merge 3 commits into
googleapis:mainfrom
thiyaguk09:feat/7350-dynamic-imports-perf
Draft

refactor(storage): dynamically import mime and p-limit with module caching#9230
thiyaguk09 wants to merge 3 commits into
googleapis:mainfrom
thiyaguk09:feat/7350-dynamic-imports-perf

Conversation

@thiyaguk09

@thiyaguk09 thiyaguk09 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #7350

@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Sep 1, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces lazy loading for the mime and p-limit dependencies to improve startup performance. Direct imports of these modules have been replaced with helper functions getMime and getPLimit in util.ts which dynamically import and cache the modules. The Bucket, File, and TransferManager classes have been updated to asynchronously retrieve these dependencies when needed, and the corresponding test suites have been updated to mock these new helpers. I have no feedback to provide as there are no review comments.

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

Labels

api: storage Issues related to the Cloud Storage API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Explore Dynamic Imports for mime and p-limit for improve performance

1 participant