-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomersperformancePerformance optimization or inefficiencyPerformance optimization or inefficiency
Description
Performance Inefficiency
Location: Lines 743-750 in FleetImporter/FleetImporter.py
Issue: Downloads entire file from S3 just to calculate SHA256 hash - wasteful for large packages.
if package_was_uploaded:
hash_sha256 = self._calculate_file_sha256(pkg_path)
else:
hash_sha256 = self._calculate_s3_file_sha256(aws_s3_bucket, s3_key)Impact:
- Unnecessary network bandwidth usage
- Slower execution for large packages
- Increased AWS data transfer costs
Current Implementation:
The _calculate_s3_file_sha256 method downloads the entire file just to hash it.
Recommended Fix:
- Store SHA256 hash as S3 object metadata during upload
- Retrieve hash from metadata instead of downloading file
- Use S3 ETag for verification (multipart uploads are different)
# During upload
s3_client.put_object(
Bucket=bucket,
Key=s3_key,
Body=file_data,
Metadata={
'sha256': calculated_hash
}
)
# During retrieval
head_response = s3_client.head_object(Bucket=bucket, Key=s3_key)
hash_sha256 = head_response['Metadata'].get('sha256')Priority: Low-Medium - Optimization opportunity
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomersperformancePerformance optimization or inefficiencyPerformance optimization or inefficiency