Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Performance gap between OCI Python SDK and boto3 for object downloads

Abierto
#755 7 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
python

Línea de trabajo

Comienza reproduciendo la comparación usando las dos rutas de OCI indicadas: response.data.content y response.data.raw.stream, junto con la línea base de boto3, con los tamaños de objeto y la concurrencia indicados. No se especifica ningún archivo fuente ni prueba; se considera terminado cuando se determine si la diferencia es esperable y se documente cualquier optimización o explicación compatible.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

SDK
Environment details
  • Python version: 3.9.18
  • pip version: 23.2.1
  • oci version: 2.111.0
Issue

We are comparing the download performance of the OCI Python SDK and boto3 (AWS SDK). For the same objects stored in an OCI bucket, we’ve observed that the OCI SDK is approximately 20% to 50% slower than boto3 when downloading to memory.

Methods Tested with OCI SDK
  1. Using response.data.content :
response = self._oci_client.get_object(
    namespace_name=self._namespace, bucket_name=bucket, object_name=key, range=bytes_range
)
return response.data.content 
  1. Using response.data.raw.stream
    Get idea from this issue, this method is ~60% faster than method 1 but still ~20% slower than boto3:
response = self._oci_client.get_object(
    namespace_name=self._namespace, bucket_name=bucket, object_name=key, range=bytes_range
)
content = bytearray()
for chunk in response.data.raw.stream(1024 * 1024, decode_content=False):  # 1MB chunks
    content.extend(chunk)
return bytes(content)

Note: We tested various chunk sizes, but they did not yield further improvements.

boto3 Baseline Implementation
response = s3_client.get_object(Bucket=bucket_name, Key=key)
return response['Body'].read()
Performance Results

With ThreadPoolExecutor(max_workers=16), I got following average throughput downloading 64MB x 1000 objects from the same OCI bucket to memory:

  • boto3 get_object: 9.8 Gbps
  • OCI SDK response.data.content: 4.1 Gbps
  • OCI SDK response.data.raw.stream: 6.8 Gbps

The gap remains consistent across multiple test runs, including various multithreaded and multiprocessed setups.

Questions
  1. Is this performance gap expected?
  2. Are there any recommended optimizations or best practices for improving download performance with the OCI Python SDK?
  3. Are there any internal differences in how OCI supports S3-compatible APIs handling downloads that might explain the performance gap?

Thanks!

Lenguaje dominante
Python
Estrellas
474
Forks
321
Merge medio
23 min
PR fusionados (30 d)
4

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de oracle/oci-python-sdk

Todos los issues de oracle/oci-python-sdk

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.