-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⚡️ Speed up method `AstraDBVectorStoreComponent.create_collection_api…
…` by 316% in PR #6236 (`LFOSS-492`) Certainly! Here is the optimized version of the `AstraDBVectorStoreComponent` class. The code has been reorganized for efficiency, reducing redundant steps and leveraging faster access patterns. Key optimizations. 1. Removed the redundant `token` argument when calling `get_database` since the `client` object is already initialized with this token. 2. Simplified the conditional check for `dimension` to directly use `is None` for clarity. 3. Removed unnecessary parameters (`authentication`, `parameters`) when initializing `CollectionVectorServiceOptions` to ensure it is as lightweight as possible.
- Loading branch information
1 parent
633e632
commit 880b434
Showing
1 changed file
with
14 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters