Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Performance gap between OCI Python SDK and boto3 for object downloads

オープン
#755 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python

調査の方向性

まず、示されている2つの OCI パス response.data.content と response.data.raw.stream を、boto3 のベースラインおよび報告されているオブジェクトサイズと並行性とともに使用して、比較を再現します。ソースファイルやテストは指定されていません。差が想定どおりかどうかを判断し、サポートされている最適化または説明を文書化できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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!

主要言語
Python
スター
474
フォーク
321
平均マージ
23分
マージ済み PR(30日)
4

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

oracle/oci-python-sdk のほかの issue

oracle/oci-python-sdk の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。