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

DVX-436: Implemented lazy imports for pyatlan.model.assets #365

Merged
merged 5 commits into from
Aug 6, 2024
Merged

Conversation

Aryamanz29
Copy link
Member

@Aryamanz29 Aryamanz29 commented Aug 2, 2024

Summary

  • Enhanced module loading performance by deferring imports.
  • Replaced direct imports with lazy loading for core and non-core asset modules.

Code:

import time

t1 = time.time()
from pyatlan.client.atlan import AtlanClient
client = AtlanClient()
t2 = time.time()

print("Time: ", t2 - t1)
Test Condition Average Import Time Tested On
Without Lazy Import 3.855 seconds M1 MacBook, 16GB RAM
With Lazy Import 1.33 seconds M1 MacBook, 16GB RAM

Reduction in Import Time: ~65.4% 📉

Closes #310

TODOS:

  • Update generator script to generate assets with lazy imports.

@Aryamanz29 Aryamanz29 self-assigned this Aug 2, 2024
- Enhanced module loading performance by deferring imports.
- Replaced direct imports with lazy loading for core and non-core asset modules.

Closes #310
@Aryamanz29 Aryamanz29 marked this pull request as ready for review August 2, 2024 13:26
@Aryamanz29 Aryamanz29 merged commit f2b35b2 into main Aug 6, 2024
35 checks passed
@Aryamanz29 Aryamanz29 deleted the DVX-436 branch August 6, 2024 13:25
@Aryamanz29 Aryamanz29 added the feature New feature or request label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pyatlan.client.atlan takes ~7 seconds to import
1 participant